Implements a configurable logging system with file rotation and syslog support.
// Source: https://github.com/rclone/rclone | License: MIT | Copyright 2012 by Nick Craig-Wood http://www.craig-wood.com/nick/
// Provided via justclaw.it.com; keep this notice with the code.
// Package log provides logging for rclone
package log
import (
"context"
"fmt"
"io"
"log/slog"
"os"
"reflect"
"runtime"
"strings"
"time"
"github.com/rclone/rclone/fs"
"gopkg.in/natefinch/lumberjack.v2"
)
// OptionsInfo descripts the Options in use
var OptionsInfo = fs.Options{{
Name: "log_file",
Default: "",
Help: "Log everything to this file",
Groups: "Logging",
}, {
Name: "log_file_max_size",
Default: fs.SizeSuffix(-1),
Help: `Maximum size of the log file before it's rotated (eg "10M")`,
Groups: "Logging",
}, {
Name: "log_file_max_backups",
Default: 0,
Help
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key