-
Notifications
You must be signed in to change notification settings - Fork 294
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
For reference: LoggerWithSource #143
Comments
Hmm this would be useful in frameworks where they'd like to set a consistent source (i.e. module name) and have the issue highlighted in #145 (namely that you get the folder containing the source file rather than the module). However, I don't think that's reason to add |
I was curious though – and maybe this is the wrong place to ask – why |
PR #135 introduces a
source
parameter that defaults to the module in which a log statement was made.See there for a long discussion why that matters -- long story short: it enables us to share a logger instance with an un-changing label, yet still keep the "this was logged from sub-component X (the module)".
We also considered adding a
LoggerWithSource
back then, however we decided that there are few use-cases about it today and we want to take it slow adding API. This ticket is to collect interest if this type should also ship with the swift-log library or not necessarily, as we learn about usage patterns.The
LoggerWithSource
allows for overriding with a hardcoded source e.g. "thread-pool-x" or something the source of the log message. We concluded however that in most situations such things can be handled with metadata. If we see that overriding a source becomessnippets above are from the impl by @weissi.
The text was updated successfully, but these errors were encountered: