ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
114 stars 18 forks source link

Tweaks for default log level (Fixes #267) #273

Closed alikins closed 5 years ago

alikins commented 5 years ago
SUMMARY

Various tweaks for #267

Fixes #267

Better format for info log msgs for installs

Only log display_callback msgs at DEBUG level

Log GalaxyErrors exc info that make it to main at debug

On cli startup, log a info line with basic info And 'info' level log the exit code.

For ex:

[2019-05-30 11:17:51,249 28223 I] ansible_galaxy_cli.cli.galaxy run:236 - exe="/home/adrian/venvs/mazer040test/bin/mazer" version=0.5.0 config_file="/home/adrian/.ansible/mazer.yml"  collections_path="/home/adrian/.ansible/collections" server=http://localhost:8000 action=install

Move impl of mazer version from actions->mazer_version Move the impl details of collecting the mazer version info for mazer version to ansible_galaxy.mazer_version so that other modules can use it (namely, ansible_galaxy.cli.galaxy for logging info at cli startup)

By default, only log http info to mazer-http.log

Set default logging level to INFO

Let log handler set basename rel to MAZER_HOME. So a logging config (the default logging config in particular) can provide a 'basename' arg for ExpandTildeWatchedFileHandler that will be used relative to MAZER_HOME.

So:

    $ mkdir /tmp/mazer_home
    $ MAZER_HOME=/tmp/mazer_home mazer install testing.foo

Will use any config in /tmp/mazer_home/, plus by default install collections to MAZER_HOME/collections, will also now log by default to MAZER_HOME/mazer.log and MAZER_HOME/mazer-http.log

ISSUE TYPE
MAZER VERSION

name = mazer
version = 0.5.0
config_file = /home/adrian/.ansible/mazer.yml
uname = Linux, newswoop, 5.0.5-200.fc29.x86_64, #1 SMP Wed Mar 27 20:58:04 UTC 2019, x86_64
executable_location = /home/adrian/venvs/mazer_0.4.0_py36/bin/mazer
python_version = 3.6.8 (default, Jan 27 2019, 09:00:23) [GCC 8.2.1 20181215 (Red Hat 8.2.1-6)]
python_executable = /home/adrian/venvs/mazer_0.4.0_py36/bin/python