mirror of
https://github.com/rclone/rclone.git
synced 2026-06-10 09:24:33 -04:00
JSON logs reported "source":"slog/logger.go:256" instead of the real caller. getCaller skips logging-machinery frames by file path, but release builds use -trimpath which rewrites the standard library slog frame's path to "log/slog/logger.go" - matching neither the "/log/" nor the "log.go" check, so it was reported as the source. Also skip frames whose function belongs to the log/slog package, which is immune to -trimpath.