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

Child logger caching #39

Closed
terrisgit opened this issue Jun 16, 2021 · 1 comment
Closed

Child logger caching #39

terrisgit opened this issue Jun 16, 2021 · 1 comment

Comments

@terrisgit
Copy link
Contributor

terrisgit commented Jun 16, 2021

logger() and child() currently return new objects and therefore callers should cache their return values. Here's a potential performance fix.

  1. logger(cat, logger) will associate logger with the category cat and returns logger
  2. Loggers::logger(cat) will associate the returned logger with the category cat but Logger::logger() does not do this
  3. logger(foo) returns the logger associated with foo if it exists

Cache a child logger:

loggers.logger('a', loggers.child('t'))
@dev-guy
Copy link
Collaborator

dev-guy commented Jun 18, 2021

v3.3.0

@dev-guy dev-guy closed this as completed Jun 18, 2021
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