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
log/syslog: using log flags and a tag at the same time #5689
Labels
Comments
Comment 3 by pierre.louis.roman: Didn't think about that issue, you're right. I agree it is easy to duplicate the code, that's what I did, but adding an argument seems easier, proper, and would let everybody else use this feature. Adding a function with three arguments, and let the one with two arguments unchanged, would be compatible, but perhaps it would not be the "go way". See the attached file. And thanks for the feedback. Attachments:
|
forgot to mention that there is a SetPrefix for log.Logger. http://golang.org/pkg/log/#Logger.SetPrefix |
Comment 5 by pierre.louis.roman: Yes there is, but the prefix is printed at the beginning of the line while the tag is included in the syslog line, which format is also used by other programs. http://golang.org/src/pkg/log/syslog/syslog.go#L251 So they are two different strings. Using syslog.NewLogger() forces you to have the absolute path to the executable as a tag because the tag is set to "", see: http://golang.org/src/pkg/log/syslog/syslog.go#L110 |
Sorry, we don't want additions to this package. We regret adding syslog to the standard library and are not accepting additions to it. Like Minux said, this can be done easily enough by caller code. If that's too onerous, feel free to fork log/syslog on github to extend it. Status changed to WorkingAsIntended. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by pierre.louis.roman:
Attachments:
The text was updated successfully, but these errors were encountered: