diff options
Diffstat (limited to 'lib/textui/log.go')
-rw-r--r-- | lib/textui/log.go | 15 |
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() |