Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback and api client logging aren't configured if server dependencies aren't installed #112

Open
dmsimard opened this issue Jan 29, 2020 · 0 comments
Labels
bug plugins Related to the Ansible plugins

Comments

@dmsimard
Copy link
Contributor

What component is this about ?

ara_default callback plugin

What is happening ?

The callback plugin instanciates it's logger here:

self.log = logging.getLogger("ara.plugins.callback.default")

And the http client here:

self.log = logging.getLogger(__name__)

However, the logging configuration is currently in fact supplied by Django:

LOG_LEVEL = settings.get("LOG_LEVEL", "INFO")
# fmt: off
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {"normal": {"format": "%(asctime)s %(levelname)s %(name)s: %(message)s"}},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "normal",
"level": LOG_LEVEL,
"stream": "ext://sys.stdout",
}
},
"loggers": {
"ara": {
"handlers": ["console"],
"level": LOG_LEVEL,
"propagate": 0
}
},
"root": {
"handlers": ["console"],
"level": LOG_LEVEL
},
}
# fmt: on

So when the callback and client are used by themselves, they won't print debug statements even if ARA_LOG_LEVEL is DEBUG.

What should be happening ?

The callback and API clients should have a fallback/default logging configuration when running standalone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plugins Related to the Ansible plugins
Projects
None yet
Development

No branches or pull requests

1 participant