log module¶
|
- class Logger(session_id: int, logger_name: str)[source]¶
Bases:
object
- log(level: LogLevel, text: str | Any, logger: str | None = '', 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: str | Any, logger: str | None = '')[source]¶
log_alert
Logs message console and to a pop up window if run through the GUI.
- log_debug(text: str | Any, logger: str | None = '')[source]¶
log_debug
Logs debugging information messages to the console.
- log_error(text: str | Any, logger: str | None = '')[source]¶
log_error
Logs message to console, if run through the GUI it logs with Error icon, focusing the error console.
- log_info(text: str | Any, logger: str | None = '')[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 | None = 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! >>>