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

Added protection against log modules logging against themselves when using createLogger #747

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

johnman
Copy link
Member

@johnman johnman commented Oct 17, 2024

A log module is a log sink. It is passed a createLogger function as it is a module but if used it would result in the logged messages being passed back to itself (as well as other log sinks).

An additional check has been done when initialising log modules to prevent the log sink linked logger being passed. A local logger is returned that logs just to the console (for debugging purposes) when called from a log module.

…using createLogger

A log module is a log sink. It is passed a createLogger function as it is a module but if used it would result in the logged messages being passed back to itself (as well as other log sinks).

An additional check has been done when initializing log modules to prevent the log sink linked logger being passed. A local logger is returned that logs just to the console (for debugging purposes) when called from a log module.
@johnman johnman merged commit 7abfa03 into main Oct 17, 2024
5 checks passed
@johnman johnman deleted the dev/log-module-local-logger branch October 17, 2024 12:20
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

Successfully merging this pull request may close these issues.

2 participants