logging ¤
Logging module.
Classes:
-
Logger
–Static class to store loggers.
-
LoggingFormatter
–Custom logging formatter.
Logger ¤
Static class to store loggers.
Methods:
-
get_logger
–Return a logger.
-
set_level
–Set level of logging for all loggers.
get_logger staticmethod
¤
Return a logger.
Parameters:
-
name
(str
) –Name to pass to the logging module.
-
level
(int | None
, default:None
) –Level of logging.
-
fmt
(str
, default:':%(lineno)d: %(message)s'
) –Format string.
Returns:
-
Logger
–Logger from
logging.getLogger
.
Source code in src/archan/logging.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
set_level staticmethod
¤
set_level(level: int) -> None
Set level of logging for all loggers.
Parameters:
-
level
(int
) –Level of logging.
Source code in src/archan/logging.py
17 18 19 20 21 22 23 24 25 26 |
|
LoggingFormatter ¤
Bases: Formatter
Custom logging formatter.
Methods:
-
format
–Override default format method.
format ¤
Override default format method.
Parameters:
-
record
(LogRecord
) –A log record.
Returns:
-
str
–The formatted record.
Source code in src/archan/logging.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|