Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Latest commit

 

History

History
78 lines (53 loc) · 1.97 KB

README.md

File metadata and controls

78 lines (53 loc) · 1.97 KB

py-logging

Configurable and easy extendable python logger

Build with python That works?

Status:

Branch Tests Code Quality
master buddy pipeline CodeFactor Grade

Usage

Basic

from pylogging.logger import Logger
from pylogging.log_level import LogLevel

logger = Logger()

logger.log(LogLevel.INFO, "Connection initialized")
logger.log(LogLevel.WARNING, "The rat bit your cables")
logger.log(LogLevel.ERROR, "The plague of rats in the server room")

showcase

Formatters

Scope
from pylogging.logger import Logger
from pylogging.log_level import LogLevel

logger = Logger()
logger.set_options({"scope": True})

logger.log(LogLevel.ERROR, "Cannot connect to host")
showcase
List
from pylogging.logger import Logger
from pylogging.log_level import LogLevel

logger = Logger()

logger.log(LogLevel.INFO, ["List", "List"])
showcase
Dictionary
from pylogging.logger import Logger
from pylogging.log_level import LogLevel

logger = Logger()

logger.log(LogLevel.INFO, {"1": "Value1", "2": "Value2"})
showcase