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

Don't set logging level when used as a library #232

Open
milliams opened this issue Sep 11, 2020 · 1 comment
Open

Don't set logging level when used as a library #232

milliams opened this issue Sep 11, 2020 · 1 comment
Labels
type: feature A self-contained enhancement or new feature

Comments

@milliams
Copy link

Server.serve calls Server._setup_logging which explicitly sets the logging level to INFO and hooks up the tornado logger to the output too.

As a user of a library, I should be able to be in control about what gets printed to the screen of my app and what dependencies of mine log to where.

I can fix this by monkey-patching the code with:

server = Server()
server._setup_logging = lambda: None
server.serve(root=".")

but I think that by default the library should not alter the loggers and they should instead be set in cli.py, allowing the CLI experience to be nice but giving library users the flexibility to set things how they wish.

@pradyunsg pradyunsg added the type: feature A self-contained enhancement or new feature label Sep 18, 2020
@pradyunsg
Copy link
Collaborator

I think we should use our own logger instance instead of the global logger for this. PRs welcome! ^>^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A self-contained enhancement or new feature
Projects
None yet
Development

No branches or pull requests

2 participants