Skip to content

Two1 logger and custom loggers conflict. Good practice suggestion? #17

@zxpectre

Description

@zxpectre

I have been trying to customize my own logger for my server but the class of logging.getLoggerClass() changes to two1.commands.util.logger.ClickLogger after importing some two1 modules that are necesary for login and other purposes, I presume, this happends because of this few lines of code at the end of two1/commands/util/logger.py :


# adds the handler, formatter, and sets default level to the second lowest
click_logger.addHandler(click_log_handler)
click_logger.setLevel(logging.INFO)
logging.setLoggerClass(ClickLogger)


What would be the right/recommended way of customizing my own server logger without messing with two1 logger?

Altering last used logger config. (obtained with logging.getLogger()) causes both loggers to interfiere with each other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions