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

Logging [on branch COM] #1

Open
sudogauss opened this issue Jan 28, 2023 · 1 comment
Open

Logging [on branch COM] #1

sudogauss opened this issue Jan 28, 2023 · 1 comment

Comments

@sudogauss
Copy link

The way of logging is not clear enough. Decorators introduce certain redundancy as you must double method declaration in logger module each time. Why not to just use python logging library with custom configuration for each process (eliminates dependency). There is no problem to put your logs with appropriate log level directly into your code and filter levels in prod mode. Do something like that instead (in)

import logging

class BaseMicro:
    def __init__(self) -> None:
        self.logger = logging.getLogger('your_package_logger')

You can init your logger(for the whole package) in your init.py.

@EKnight-Blue
Copy link
Collaborator

Decorators make methods shorter and separates logging from the functional code, it makes debuging easier.
And we seem to have a custom logging library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants