-
Notifications
You must be signed in to change notification settings - Fork 0
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 #125
logging #125
Conversation
If there is an exception while running a mode, print to log, generate plot (if there is anything to plot) and continue with next mode.
ebus_toolbox/__main__.py
Outdated
print(f"Writing log to {log_path}") | ||
log_handlers.append(logging.FileHandler(log_path)) | ||
logging.basicConfig( | ||
level=vars(logging)[args.loglevel], |
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.
Could splitting file and stream logging levels be useful?
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.
This is a question for @j-brendel. In my opinion, it should not be split, as both should display the same (the file log is just the captured console log). And it is more difficult to separate these two.
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.
Moved this issue here: #127
- logging.warning instead of logging.warn (deprecated) - correct spelling of SpiceEV - remove DEBUG logging of matplotlib - move logging setup to util
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.
Just one minor remark. The functionality is fine to me, having noted issue #127
@@ -87,6 +87,15 @@ default_buffer_time_opps = 0 | |||
# Options: HV, HV/MV, MV, MV/LV, LV (default: MV) | |||
default_voltage_level = "MV" | |||
|
|||
##### LOGGING ##### |
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.
The file created has ANSI encoding on my PC. Is it possible to change to UTF-8 (hardcoded?)
Add logging to file in addition to console output. Can be configured:
--help
or logging docu for all options.null
to disable file logging.All warnings are written to log as well.
If there is an exception during a mode, it is written to the logfile (with traceback), a plot is generated (if there is anything to plot) and the program continues with the next mode (if possible).