Closed methane closed 4 months ago
The errors.go
file was updated to enhance logging capabilities. A Print
method was added to the Logger
interface, and a new stdLog
type was introduced to wrap the standard log.Logger
with an adjusted call depth. Additionally, the defaultLogger
variable now uses the StdLogger
function to initialize a Logger
, improving flexibility and consistency in logging.
File | Change Summary |
---|---|
errors.go |
Added Print(v ...any) to Logger interface, introduced stdLog type, and added StdLogger function to wrap log.Logger with adjusted call depth. Updated defaultLogger to use StdLogger . |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
I prefer #1589 over this because #1589 can show "filename:lineno" even for custom writers.
Description
In #1563, we added
mc.log()
helper function that wraps mc.cfg.Logger.Print(). But it broke log.Logger withlog.Lshortfile
flag. All logs showsconnection.go:50
.We need to adjust calldepth. We need to backport this to 1.8 branch or revert #1564 in the branch.
Checklist