remotior_sensus.core.log module
Logging manger.
Core class that manages logs during processes.
Typical usage example:
>>> # create a log file in a directory
>>> Log(directory='directory_path', level=10)
- class remotior_sensus.core.log.Log(file_path: None | str = None, directory: None | str = None, level: int | str | None = None, multiprocess=False, time=True, stream_handler=True)
Bases:
object
- __init__(file_path: None | str = None, directory: None | str = None, level: int | str | None = None, multiprocess=False, time=True, stream_handler=True)
Manages logs.
This module allows for managing logs of processes.
- file_path
path of a log file.
- directory
directory path where a log file is created if file_path is None.
- level
level of logging (10 for DEBUG, 20 for INFO).
- multiprocess
if True, sets logging for parallel processes.
- time
if True, time is saved in log file.
- stream_handler
if True, create stream handler.
Examples
- Create a log file and starts logging.
>>> Log(file_path='file.txt', level=20)
- log = None
- set_level(level)