summaryrefslogtreecommitdiff
path: root/lib/textui/log.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 22:43:58 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 22:43:58 -0700
commitd675f41242c043ddc4c6c1a1fb8aabcfd324aae2 (patch)
tree4f2afbce761eb377ad0b0ab2e4fb2f478ff844f5 /lib/textui/log.go
parent9971e38110d5f90d15c7b78f396f2638b3952a96 (diff)
parent6e1a9fbb1e9a943e04902ed3a4958f6821e39456 (diff)
Merge branch 'lukeshu/lint'
Diffstat (limited to 'lib/textui/log.go')
-rw-r--r--lib/textui/log.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/textui/log.go b/lib/textui/log.go
index 5ddc7a8..d2373f8 100644
--- a/lib/textui/log.go
+++ b/lib/textui/log.go
@@ -1,5 +1,5 @@
-// Copyright (C) 2019-2022 Ambassador Labs
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2019-2022-2023 Ambassador Labs
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: Apache-2.0
//
@@ -134,21 +134,21 @@ func (l *logger) Log(lvl dlog.LogLevel, msg string) {
// UnformattedLog implements dlog.OptimizedLogger.
func (l *logger) UnformattedLog(lvl dlog.LogLevel, args ...any) {
l.log(lvl, func(w io.Writer) {
- printer.Fprint(w, args...)
+ _, _ = printer.Fprint(w, args...)
})
}
// UnformattedLogln implements dlog.OptimizedLogger.
func (l *logger) UnformattedLogln(lvl dlog.LogLevel, args ...any) {
l.log(lvl, func(w io.Writer) {
- printer.Fprintln(w, args...)
+ _, _ = printer.Fprintln(w, args...)
})
}
// UnformattedLogf implements dlog.OptimizedLogger.
func (l *logger) UnformattedLogf(lvl dlog.LogLevel, format string, args ...any) {
l.log(lvl, func(w io.Writer) {
- printer.Fprintf(w, format, args...)
+ _, _ = printer.Fprintf(w, format, args...)
})
}
@@ -159,6 +159,7 @@ var (
)
func init() {
+ //nolint:dogsled // I can't change the signature of the stdlib.
_, file, _, _ := runtime.Caller(0)
thisModDir = filepath.Dir(filepath.Dir(filepath.Dir(file)))
}
@@ -171,8 +172,8 @@ func (l *logger) log(lvl dlog.LogLevel, writeMsg func(io.Writer)) {
// This is optimized for mostly-single-threaded usage. If I cared more
// about multi-threaded performance, I'd trade in some
// memory-use/allocations and (1) instead of using a static `logBuf`,
- // I'd have a `logBufPool` `sync.Pool`, and (2) have the the final call
- // to `l.out.Write()` be the only thing protected by `logMu`.
+ // I'd have a `logBufPool` `sync.Pool`, and (2) have the final call to
+ // `l.out.Write()` be the only thing protected by `logMu`.
logMu.Lock()
defer logMu.Unlock()
defer logBuf.Reset()