Coverage for src/pysumo/logger/infolog : 79%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" The pySUMO informational log handler. Acts as an initializer for the python logging framework and defines several convenience functions for working with it.
This module contains:
- InfoLog: The informational log handler.
"""
""" The informational log handler for pySUMO. Initializes the python logging framework and contains several convenience functions. Instantiated only from the entry point.
Variables:
- default_log_path: The default path where the infolog will be stored. - default_socket_path: The default socket to which >=INFO logs will be sent. - filename: The location at which the infolog will be stored. - root_logger: The root logging object of which all other loggers are children. - f_handler: Sends messages to a file and rotates it when it becomes too large. - s_handler: Sends messages to a Unix socket.
Methods:
- set_loglevel: Sets the loglevel above which to log messages.
"""
""" Initializes the python logging framework.
Kwargs:
- loglevel: the loglevel above which entries are logged - filename: log location
""" except PermissionError: makedirs(CONFIG_PATH, exist_ok=True) self.filename = self.default_log_path self.socket = self.default_socket_path self.f_handler = logging.handlers.RotatingFileHandler(self.filename, maxBytes=102400, backupCount=2) s_handler = logging.handlers.SocketHandler(self.socket, None)
""" Sets the loglevel above which to log messages. """ self.f_handler.setLevel(loglevel) |