Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select logger level at startup #9

Closed
CuriousDolphin opened this issue Nov 21, 2024 · 1 comment · Fixed by #22
Closed

Select logger level at startup #9

CuriousDolphin opened this issue Nov 21, 2024 · 1 comment · Fixed by #22
Assignees
Labels
enhancement New feature or request

Comments

@CuriousDolphin
Copy link
Member

No description provided.

@giuseppeambrosio97
Copy link
Contributor

giuseppeambrosio97 commented Dec 4, 2024

@cache
def get_logger(name="focoos", level=logging.DEBUG):
    logger = logging.getLogger(name)
    logger.setLevel(level)
    return logging.getLogger(name)


def setup_logging():
    logging.config.dictConfig(LOGGING_CONFIG)
    logger = get_logger()
    return logger

use default config logging level only in get_logger, because the main purpose of setup_logging is to set the config defined in LOGGING_CONFIG.

@giuseppeambrosio97 giuseppeambrosio97 added the enhancement New feature or request label Dec 4, 2024
@giuseppeambrosio97 giuseppeambrosio97 linked a pull request Dec 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants