Hammer Log File Location

Problem: Default hammer log file location is in a system directory (/var/log/hammer/hammer.log) and not a per-user directory

Given that hammer(1) can and should have unprivileged users, this seems like a strange default log file location.

I can only produce this error once (without removing ~/.cache), as the process creates:

~/.cache/
~/.cache/apipie_bindings
~/.cache/apipie_bindings/{FOREMAN_URL}
~/.cache/apipie_bindings/{FOREMAN_URL}/v2
~/.cache/apipie_bindings/{FOREMAN_URL}/v2/{HEX_STRING}.en.json
~/.cache/hammer_completion.json

Reproduction Method:

rm -rf ~/.cache/
hammer disc{{Press Tab}}

So it happens when tab-completion needs to create the completion file.

Generated Error Message:

No permissions to create log dir /var/log/hammer.
File /var/log/hammer/hammer.log not writeable, won't log anything to the file!
environment command is deprecated and will be removed in one of the future versions. Please use puppet-environment command instead.
report command is deprecated and will be removed in one of the future versions. Please use config-report command instead.

Expected outcome: Log files for hammer should be created within the user’s home directory, the actual location I leave to others to determine.

Foreman and Proxy versions: 2.4.0

Foreman and Proxy plugin versions: 2.4.0

Distribution and version: CentOS 8.3

Other relevant data:

https://projects.theforeman.org/issues/32467