Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

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

Merged
merged 8 commits into from
May 30, 2019

Conversation

alikins
Copy link
Contributor

@alikins alikins commented May 30, 2019

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
  • Bugfix Pull Request
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

alikins added 8 commits May 30, 2019 13:47
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

Fixes ansible#267
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)

Fixes ansible#267
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

Fixes ansible#267
@alikins alikins merged commit f1c5af5 into ansible:devel May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review logging and default logging config (make sure default level is INFO)
1 participant