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

Rename file term to caller #437

Closed
wants to merge 2 commits into from
Closed

Rename file term to caller #437

wants to merge 2 commits into from

Conversation

willfaught
Copy link
Contributor

@willfaught willfaught commented Jan 14, 2017

WIP

Fixes #432.

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 {
Copy link
Member

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
Copy link
Member

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]+)?`
Copy link
Member

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.

@peterbourgon
Copy link
Member

You'll need to update the tests, too.

@willfaught
Copy link
Contributor Author

willfaught commented Jan 14, 2017 via email

@willfaught
Copy link
Contributor Author

willfaught commented Jan 14, 2017 via email

@peterbourgon peterbourgon mentioned this pull request Jan 16, 2017
6 tasks
@willfaught willfaught closed this Jan 17, 2017
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

Successfully merging this pull request may close these issues.

2 participants