Rename file term to caller#437
Closed
willfaught wants to merge 2 commits intogo-kit:masterfrom
willfaught:patch-3
Closed
Rename file term to caller#437willfaught wants to merge 2 commits intogo-kit:masterfrom willfaught:patch-3
willfaught wants to merge 2 commits intogo-kit:masterfrom
willfaught:patch-3
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 { |
Member
There was a problem hiding this comment.
To preserve backwards compatibility, could we leave the name of the option as FileKey?
| Logger | ||
| timestampKey string | ||
| fileKey string | ||
| callerKey string |
Member
There was a problem hiding this comment.
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]+)?` |
Member
There was a problem hiding this comment.
And likewise leave this as logRegexpFile. Essentially just changing the default constant.
Member
|
You'll need to update the tests, too. |
Contributor
Author
|
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>
.
|
Contributor
Author
|
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>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP
Fixes #432.