log module¶
Class |
Description |
---|---|
- class Logger[source]
Bases:
object
- close_logs()[source]
close_logs
close all log files.- Return type:
None
- is_output_redirected_to_log()[source]
- log(level: LogLevel, text: Any, logger: str = '', session: int = 0)[source]
log
writes messages to the log console for the given log level.LogLevelName
LogLevel
Description
DebugLog
0
Logs debugging information messages to the console.
InfoLog
1
Logs general information messages to the console.
WarningLog
2
Logs message to console with Warning icon.
ErrorLog
3
Logs message to console with Error icon, focusing the error console.
AlertLog
4
Logs message to pop up window.
- log_alert(text: Any, logger: str = '')[source]
log_alert
Logs message console and to a pop up window if run through the GUI.
- log_debug(text: Any, logger: str = '')[source]
log_debug
Logs debugging information messages to the console.
- log_error(text: Any, logger: str = '')[source]
log_error
Logs message to console, if run through the GUI it logs with Error icon, focusing the error console.
- log_info(text: Any, logger: str = '')[source]
log_info
Logs general information messages to the console.
- log_to_file(min_level: LogLevel, path: str, append: bool = False)[source]
log_to_file
redirects minimum log level to a file namedpath
, optionally appending rather than overwriting.
- log_to_stderr(min_level: LogLevel)[source]
log_to_stderr
redirects minimum log level to standard error.- Parameters:
min_level (LogLevel) – minimum level to log to
- Return type:
None
- log_to_stdout(min_level: LogLevel = LogLevel.InfoLog)[source]
log_to_stdout
redirects minimum log level to standard out.- Parameters:
min_level (LogLevel) – minimum level to log to
- Return type:
None
- Example:
>>> log_debug("Hotdogs!") >>> log_to_stdout(LogLevel.DebugLog) >>> log_debug("Hotdogs!") Hotdogs! >>>
- log_warn(text: Any, logger: str = '')[source]
log_warn
Logs message to console, if run through the GUI it logs with Warning icon.
- redirect_output_to_log()[source]