Logger#
- class dpeeg.tools.Logger(logger: str = 'dpeeg_root', path: str | None = None, mode: str = 'a', clevel: int | str = 20, flevel: int | str | None = None)[source]#
Logging hooks for terminals and file streams.
Can handle terminal printing and file writing in three situations: 1.Terminal print; 2.Terminal and file streams write simultaneously; 3.Ordinary file write.
- Parameters:
logger (str) – Specify the logger name, creating it if necessary. If no name is specified, return the root logger.
path (str, optional) – The path of log file.
mode (str) – The write mode of the log file.
clevel (int, str) – The log level of console.
flevel (int, str, optional) – The log level of filehandler. If it is None, the log file will not be written and parameter path will be ignored.