Documentation
¶
Overview ¶
Package log provides logging for rclone
Index ¶
- Variables
- func InitLogging()
- func InstallJSONLogger(logLevel fs.LogLevel)
- func NewCallerHook(levels ...logrus.Level) logrus.Hook
- func Redirected() bool
- func Stack(o interface{}, info string)
- func Trace(o interface{}, format string, a ...interface{}) func(string, ...interface{})
- type CallerHook
- type MultiWriter
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var OptionsInfo = fs.Options{{ Name: "log_file", Default: "", Help: "Log everything to this file", Groups: "Logging", }, { Name: "log_format", Default: "date,time", Help: "Comma separated list of log format options", Groups: "Logging", }, { Name: "syslog", Default: false, Help: "Use Syslog for logging", Groups: "Logging", }, { Name: "syslog_facility", Default: "DAEMON", Help: "Facility for syslog, e.g. KERN,USER", Groups: "Logging", }, { Name: "log_systemd", Default: false, Help: "Activate systemd integration for the logger", Groups: "Logging", }}
OptionsInfo descripts the Options in use
Functions ¶
func InstallJSONLogger ¶
InstallJSONLogger installs the JSON logger at the specified log level
func NewCallerHook ¶
NewCallerHook use to make a hook
func Redirected ¶
func Redirected() bool
Redirected returns true if the log has been redirected from stdout
func Stack ¶
func Stack(o interface{}, info string)
Stack logs a stack trace of callers with the o and info passed in
Types ¶
type CallerHook ¶
CallerHook for log the calling file and line of the fine
func (*CallerHook) Fire ¶
func (h *CallerHook) Fire(entry *logrus.Entry) error
Fire logs the information of context (filename and line)
func (*CallerHook) Levels ¶
func (h *CallerHook) Levels() []logrus.Level
Levels implement applied hook to which levels
type MultiWriter ¶
MultiWriter是一个自定义的Writer,它可以将输出同时写入多个Writer,例如文件和标准输出。
type Options ¶
type Options struct { File string `config:"log_file"` // Log everything to this file Format string `config:"log_format"` // Comma separated list of log format options UseSyslog bool `config:"syslog"` // Use Syslog for logging SyslogFacility string `config:"syslog_facility"` // Facility for syslog, e.g. KERN,USER,... LogSystemdSupport bool `config:"log_systemd"` // set if using systemd logging }
Options contains options for controlling the logging
var Opt Options
Opt is the options for the logger
Source Files
¶
Click to show internal directories.
Click to hide internal directories.