-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Rename file term to caller #437
Conversation
func FileKey(key string) StdlibAdapterOption { | ||
return func(a *StdlibAdapter) { a.fileKey = key } | ||
// CallerKey sets the key for the file and line field. By default, it's "caller". | ||
func CallerKey(key string) StdlibAdapterOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To preserve backwards compatibility, could we leave the name of the option as FileKey
?
@@ -27,7 +27,7 @@ func (w StdlibWriter) Write(p []byte) (int, error) { | |||
type StdlibAdapter struct { | |||
Logger | |||
timestampKey string | |||
fileKey string | |||
callerKey string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise leave this as fileKey
with a default value of "caller"
logRegexpMsg = `(: )?(?P<msg>.*)` | ||
logRegexpDate = `(?P<date>[0-9]{4}/[0-9]{2}/[0-9]{2})?[ ]?` | ||
logRegexpTime = `(?P<time>[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?)?[ ]?` | ||
logRegexpCaller = `(?P<caller>.+?:[0-9]+)?` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And likewise leave this as logRegexpFile
. Essentially just changing the default constant.
You'll need to update the tests, too. |
Will do
…On Sat, Jan 14, 2017 at 6:15 AM Peter Bourgon ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In log/stdlib.go
<#437 (review)>:
> @@ -39,9 +39,9 @@ func TimestampKey(key string) StdlibAdapterOption {
return func(a *StdlibAdapter) { a.timestampKey = key }
}
-// FileKey sets the key for the file and line field. By default, it's "file".
-func FileKey(key string) StdlibAdapterOption {
- return func(a *StdlibAdapter) { a.fileKey = key }
+// CallerKey sets the key for the file and line field. By default, it's "caller".
+func CallerKey(key string) StdlibAdapterOption {
To preserve backwards compatibility, could we leave the name of the option
as FileKey?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#437 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD5VhuSEKs5y9w9R2YylzuJXvj2C1bVks5rSNiGgaJpZM4Ljkjt>
.
|
I was hoping I could get by with editing the one file on GitHub. Will fix.
…On Sat, Jan 14, 2017 at 6:17 AM Peter Bourgon ***@***.***> wrote:
You'll need to update the tests, too.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#437 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD5Vki4Q_idMGatKPMkRnWYJ18Q5Dpjks5rSNj3gaJpZM4Ljkjt>
.
|
WIP
Fixes #432.