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

Fix environment-specific rough edges of logging setup #15193

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

AlanCoding
Copy link
Member

SUMMARY

Two separate random things here. Firstly, I have no expectation that this would work:

import logging

logging.handlers.SysLogHandler

You didn't import the logging.handlers module... so why should python have loaded that module? You get SysLogHandler if you load that module. Newer versions of python will fail with this syntax, but there's no reason we shouldn't do it generally.

Next, the blanket ImportError will (logically) often error on not having colorama or whatever. But what happens then? It passes. But... if you were in this block that means that the COLOR_LOGS is True in settings. If that setting is true, that means you're using color logs, which means that the class ColorHandler will be referenced in the logging dict config. But the pass means that it won't be defined. So the error you'll get is just simply that it can't import awx.main.utils.handlers.ColorHandler

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

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

Successfully merging this pull request may close these issues.

None yet

1 participant