mirror of
https://github.com/rclone/rclone.git
synced 2026-05-12 18:38:00 -04:00
Avoid side effects by using own logger instance - Importing fs/log only sets rclone's private logger via fs.SetLogger, so internal rclone logging works from the moment the package is imported but the process-wide slog default is left untouched. - slog.SetDefault and slog.SetLogLoggerLevel move into InitLogging, which is called explicitly from the CLI (cmd/cmd.go), the librclone wrapper and the integration test framework. So rclone-as-a-program keeps capturing log.Print/log.Fatal and slog.Default() output as before. Library consumers that import fs/log without calling InitLogging now keep their own slog default and can safely route rclone output back into it via log.Handler.SetOutput without recursing. Fixes #8907 Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>