You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the current caller depth skip function only outputs the tool method layer, making it impossible to pinpoint the actual problematic code. The reason is that the logging library by default skips the first 3 layers of calls, but in reality, reaching the actual call requires skipping 4 layers. To solve this problem, it is necessary to specify an additional caller skip layer when initializing the logger.
Current code(utils.go:44): logger = level.NewFilter(logger, lvl) logger = log.With(logger, "timestamp", log.DefaultTimestampUTC, "caller", log.DefaultCaller)
Correct code: logger = level.NewFilter(logger, lvl) logger = log.With(logger, "timestamp", log.DefaultTimestampUTC, "caller", log.Caller(4))
The text was updated successfully, but these errors were encountered:
Using the current caller depth skip function only outputs the tool method layer, making it impossible to pinpoint the actual problematic code. The reason is that the logging library by default skips the first 3 layers of calls, but in reality, reaching the actual call requires skipping 4 layers. To solve this problem, it is necessary to specify an additional caller skip layer when initializing the logger.
Current code(utils.go:44):
logger = level.NewFilter(logger, lvl) logger = log.With(logger, "timestamp", log.DefaultTimestampUTC, "caller", log.DefaultCaller)
Correct code:
logger = level.NewFilter(logger, lvl) logger = log.With(logger, "timestamp", log.DefaultTimestampUTC, "caller", log.Caller(4))
The text was updated successfully, but these errors were encountered: