-
Notifications
You must be signed in to change notification settings - Fork 1.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
Make caller formatting configurable #319
Labels
Comments
skipor
added a commit
to skipor/zap
that referenced
this issue
Feb 19, 2017
CallerEncoder similar to other encoders for complex types. It allows to configure caller presentation in log.
skipor
added a commit
to skipor/zap
that referenced
this issue
Feb 20, 2017
CallerEncoder similar to other encoders for complex types. It allows to configure caller presentation in log.
skipor
added a commit
to skipor/zap
that referenced
this issue
Feb 20, 2017
CallerEncoder similar to other encoders for complex types. It allows to configure caller presentation in log.
Good point - I hadn't thought about making the caller formatting configurable, but it's a good idea. Since you have a PR open, I'll move discussion there. |
akshayjshah
changed the title
Hard to change how Entry.Caller.File is written to log
Make caller formatting configurable (like times and durations)
Feb 21, 2017
akshayjshah
changed the title
Make caller formatting configurable (like times and durations)
Make caller formatting configurable
Feb 21, 2017
akshayjshah
pushed a commit
to skipor/zap
that referenced
this issue
Mar 13, 2017
CallerEncoder similar to other encoders for complex types. It allows to configure caller presentation in log.
akshayjshah
pushed a commit
to skipor/zap
that referenced
this issue
Mar 14, 2017
CallerEncoder similar to other encoders for complex types. It allows to configure caller presentation in log.
Fixed in #327. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have problem like #304, but I want truncate file paths to <parent_folder_name/file_name>. Because of really long my app package path, even truncating to $GOPATH is not enough.
I know that in #201 decided that
And, as result, there is no way no modify
Entry.Caller
viaOption
So I found only way to do this: wrap
zapcore.Encoder
, and truncateEntry.Caller.File
before calling wrappedEncoder
. But that is really ugly way, and can't be used with beautifulConfig
helpers.My best idea how to improve usability in this case is add kind of
EncodeCaller
intoEncoderConfig
and use it to encodeCaller
. Also, this is nice way to solve #304.Other ways to improve usability:
Core
checkEncoder
easier.Config
methods exported to add ability for manualLogger
build.The text was updated successfully, but these errors were encountered: