-
Notifications
You must be signed in to change notification settings - Fork 70
[Review please!] Logging refactor / cleanup #415
Conversation
1da2472
to
d6c9d1e
Compare
|
|
Should the |
|
@dustymabe Yeah, it should :), I'll fix that. |
|
1ca21f2
to
ffd768a
Compare
@cdrage also, can journald output be another PR so that we can have some code for me to test with cockpit |
Yup. JournalD will be another PR. At the moment its not possible. I'll update the PR and add a function for cockpit only info messages so you
|
0cc39f4
to
9b7b496
Compare
1bcee57
to
a9ebb56
Compare
return input | ||
|
||
|
||
def set_logging(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's modify this to take vars as input. Looks like the few that we use are: verbose
, quiet
, and logging_output
.
That way we aren't coupled to changes in cli/main.py.
8172d95
to
3edb100
Compare
Okay so I've gone ahead and pushed all my other commits. I have one failing error right now that could be due to a bug in the test suite. Otherwise, good for another review! |
return | ||
|
||
if code == LOG_LEVELS['debug']: | ||
msg = "[DEBUG] %6d %0.2f %s" % (os.getpid(), time.time(), msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After running it a couple of times I feel like the extra output in the debug statements (the pid/time) doesn't really help debug anything any more. We don't run multiprocess so I don't think this is useful. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dustymabe updated. yeah, too much output!
So one really nice thing (for me) about the old output is that it included the name of the file in the output:
Is there a way to preserve that with the new system? |
e36e4d0
to
e5b9b43
Compare
Hey all! So I've updated the PR for final review. One thing to note is that I will be removing the syslog logging output provider until a later date. I want to do more thorough testing with that. I've also had to move a few things around in main.py in order to get the logging to output correctly. I checked to see if it would do any harm and from the looks if it, it wouldn't. Otherwise, feel free to review and test! |
custom_level = LOG_LEVELS[logging_output] | ||
break | ||
else: | ||
custom_level = LOG_LEVELS['default'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_LEVELS is a list right? could we do something like this:
if logging_output in LOG_LEVELS:
custom_level = LOG_LEVELS[logging_output]
else:
custom_level = LOG_LEVELS['default']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dustymabe Ahhhhh, forgot Python had that functinon >.> I'll add it
@dustymabe updated based on your comments for the |
Closing in favor of #565 |
This is a work-in-progress.
It currently looks like this:
DONE!
Review away :)