Skip to content

Commit

Permalink
Improve __init__ var names
Browse files Browse the repository at this point in the history
  • Loading branch information
sHermanGriffiths committed Nov 9, 2024
1 parent 3c88f77 commit 1d48612
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions n2y/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
import os


def filter_log(record: logging.LogRecord) -> logging.LogRecord:
def log_filter(record: logging.LogRecord) -> logging.LogRecord:
record.pathname = record.pathname.replace(os.getcwd() + "/", "")
return record


FORMATTER = logging.Formatter(
LOG_FORMATTER = logging.Formatter(
"%(asctime)s - %(levelname)s (%(pathname)s::%(funcName)s::%(lineno)d): %(message)s"
)
HANDLER = logging.StreamHandler()
HANDLER.setLevel(logging.INFO)
HANDLER.setFormatter(FORMATTER)
HANDLER.addFilter(filter_log)
LOG_HANDLER = logging.StreamHandler()
LOG_HANDLER.setLevel(logging.INFO)
LOG_HANDLER.setFormatter(LOG_FORMATTER)
LOG_HANDLER.addFilter(log_filter)
LOG = logging.getLogger(__name__)
LOG.addHandler(HANDLER)
LOG.addHandler(LOG_HANDLER)

0 comments on commit 1d48612

Please sign in to comment.