This is my custom logger
Project description
DM-Logger
Example
from dm_logger import DMLogger
custom_logger = DMLogger("main")
custom_logger.info("test message", tag="test tag")
custom_logger.debug("new message", id=123312)
custom_logger.info("only mess")
custom_logger.critical(env="production")
custom_logger.warning({"key": "value"})
custom_logger.error(["item1", "item2", 3])
custom_logger.info()
Initial parameters
name: str # logger name (*required)
logging_level: str = "DEBUG", # min logging level
logs_dir_path: str = "logs", # log parent directories, leave blank to not write
print_logs: bool = True, # print to the console or not
file_name: str = "", # log file name, default = <name>.log
write_mode: Literal["a", "w"] = "w", # start with new file or continue old one
max_MB: int = 5, # max log file size (MB)
max_count: int = 10, # max count of saved logs
format_string: str = "%(asctime)s.%(msecs)03d [%(levelname)s] (%(module)s.%(funcName)s:%(lineno)d) %(message)s",
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dm-logger-0.2.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for dm_logger-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65fa91fa176c19de76e514788e43c8204d9950cc7cb62068dec2362cd868b8d6 |
|
MD5 | 23a9a25f8535cf72afb7f5bd36cae177 |
|
BLAKE2b-256 | 70c352f9ab89e967540c02acee9b414933fe8bd8fbf85472f42624483ed1716d |