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

documentation: it's not clear what the "source" argument to logInfoS and friends is for #213

Open
robx opened this issue Mar 25, 2020 · 3 comments

Comments

@robx
Copy link
Contributor

robx commented Mar 25, 2020

While trying to figure out a nice way to provide context to log messages (e.g., prepend some request-specific prefix in a web handler), I ran across logInfoS. From the documentation, it was entirely unclear to me what this "source" might be. It'd be great to be a bit clearer about this.

(I've since read the source code and think that it's actually never used by log functions created through newLogFunc, so perhaps these might even be dropped? I'm going to assume I'm missing something though. It's possible to make use of the source field via mkLogFunc.)

@snoyberg
Copy link
Collaborator

PR to clear up the docs would be great. Source is intended to be a general purpose field for "what part of your application does this come from." For example, you may say source is "database" to distinguish from "web."

@robx
Copy link
Contributor Author

robx commented Mar 27, 2020

Thanks for looking into this! Would be happy to provide such a PR, but am still a bit confused.

Is it correct that in order to get the source argument displayed, I would have to create my own log function via mkLogFunction, and not be able to build on top of withLogFunc / newLogFunc? That's how I read the source code...

@snoyberg
Copy link
Collaborator

I think so.

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