twitter / communitynotes

Documentation and source code powering Twitter's Community Notes
https://twitter.github.io/communitynotes
Apache License 2.0
1.47k stars 213 forks source link

Providing logger templates #276

Open avalanchesiqi opened 1 month ago

avalanchesiqi commented 1 month ago

Is your feature request related to a problem? Please describe. In this commit, logger was introduced to replace logging to console. It is a great move. But what I miss here is where the logs are sent to. They are not in the console any more.

Describe the solution you'd like I guess there are some logger configuration files not pushed to the repo. Those configurations possibly define a FileHandler to specify the logging path. I understand that the FileHandler may direct to an internal path that should be kept private. But can you provide some templates for such logger configuration files? For example, I have to add a line

logger = logging.getLogger("birdwatch.runner")
logger.setLevel(logging.INFO)
logger.addHandler(logging.FileHandler('logs/birdwatch.runner.log'))  # added

to specify the logging output path for matrix_factorization.py. But I want to avoid adding such lines to every logger module.

Describe alternatives you've considered N/A

Additional context N/A