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

Logging requires redis #237

Open
stveit opened this issue Dec 1, 2021 · 0 comments
Open

Logging requires redis #237

stveit opened this issue Dec 1, 2021 · 0 comments

Comments

@stveit
Copy link
Contributor

stveit commented Dec 1, 2021

Is your feature request related to a problem? Please describe.
Logging is done via the log.py file, where get_logger is used to get a logger object. This obejct has a handler for writing to redis. If
redis is not running, logging will not work in cnaas-nms, as it will crash when trying to connect to redis. So if you try to run tests that test code trying to log, you are required to have a redis session.

An overall problem is that library code trying to log sets up logging handlers. Handlers should be setup by the program using the library, for instance the main program.

Describe the solution you'd like
Remove setup of handlers in get_logging(), and instead require that handlers and stuff is setup by the main program that is using the code. This way, tests can just decide to not setup the redis logging, and are then able to run tests without needing a redis session.

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

No branches or pull requests

1 participant