-
Notifications
You must be signed in to change notification settings - Fork 5
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
Logr 1.1.0 and implement stdr in terms of funcr #18
Conversation
stdr.go
Outdated
depth := l.Formatter.GetDepth() + 2 // offset for this adapter | ||
|
||
// ignore errors - what can we really do about them? | ||
if l.std != nil { |
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.
Would it make sense to avoid this if check and then perhaps the entire output
helper function by ensuring in the constructor that l.std
is always non-nil? If NewWithOptions
is called with a nil interface, the constructor could create one which calls log.Output
.
If l.std
continues to be nil in some cases, then GetUnderlying
might need a comment about that.
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.
Good idea. Will add a commit
Unrelated to this PR: Line 82 in 625208e
refers to "glogr" instead of "stdr". The comment about "The glog implementation always logs this information in its per-line header, whether this option is set or not." can be removed, log.New has the flag parameter to control this. |
There are no automated tests. Here's one that you can drop into
|
Thanks, will add the test |
a95e07b
to
cef82a3
Compare
@@ -84,7 +84,7 @@ type Options struct { | |||
// be treated as zero. | |||
Depth int | |||
|
|||
// LogCaller tells glogr to add a "caller" key to some or all log lines. | |||
// LogCaller tells stdr to add a "caller" key to some or all log lines. |
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.
The next sentence can be removed completely ("The glog implementation...").
oooops
…On Tue, Aug 24, 2021 at 10:51 AM Patrick Ohly ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In stdr.go <#18 (comment)>
:
> @@ -84,7 +84,7 @@ type Options struct {
// be treated as zero.
Depth int
- // LogCaller tells glogr to add a "caller" key to some or all log lines.
+ // LogCaller tells stdr to add a "caller" key to some or all log lines.
The next sentence can be removed completely ("The glog implementation...").
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#18 (review)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKWAVCSY3YBLHVMBUPAZ6LT6PLZ7ANCNFSM5CVFR6MA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
all glog refs removed |
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.
LGTM
No description provided.