Zap lager#22
Conversation
|
Hey MHBauer! Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA. |
|
|
||
| // SessionName returns the name of the logger session | ||
| func (l *LagerAdapter) SessionName() string { | ||
| return "why would you want the name of the logger?" |
There was a problem hiding this comment.
I honestly don't understand why this is a thing that exists.
| return &LagerAdapter{ | ||
| originalLogger: tmpLogger, | ||
| } | ||
| } |
There was a problem hiding this comment.
not sure if this is implemented correctly, and I mostly don't care.
There was a problem hiding this comment.
Session is more useful in tracing and knowing where the logs are coming from in bigger projects where a lot of component logs come through or when you have many requests and you correlate all the logs for one request.
There was a problem hiding this comment.
Saying that, lager does a special thing with session so you can track it all the way down to where the original logger was created. With the adapter we won't have that so can't use Session in that way anymore.
| func (l *LagerAdapter) SessionName() string { | ||
| return "why would you want the name of the logger?" | ||
| } | ||
|
|
There was a problem hiding this comment.
Everything below is a direct copy.
| "fmt" | ||
|
|
||
| "code.cloudfoundry.org/lager" | ||
| "go.uber.org/zap" |
| // LagerAdapter satisfies the lager.Logger interface with zap as the | ||
| // implementation. | ||
| type LagerAdapter struct { | ||
| originalLogger *zap.Logger |
There was a problem hiding this comment.
this is all pointers now.
I was bored, but we can't use the adapter from cf/routing because zap has changed.