Back to godoc.org
github.com/rclone/rclone/fs/log

package log

v1.52.2
Latest Go to latest
Published: Jun 24, 2020 | License: MIT | Module: github.com/rclone/rclone

Overview

Package log provides logging for rclone

Index

Variables

var DefaultOpt = Options{
	Format:         "date,time",
	SyslogFacility: "DAEMON",
}

DefaultOpt is the default values used for Opt

var Opt = DefaultOpt

Opt is the options for the logger

func InitLogging

func InitLogging()

InitLogging start the logging as per the command line flags

func NewCallerHook

func NewCallerHook(levels ...logrus.Level) logrus.Hook

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

func Trace

func Trace(o interface{}, format string, a ...interface{}) func(string, ...interface{})

Trace debugs the entry and exit of the calling function

It is designed to be used in a defer statement so it returns a function that logs the exit parameters.

Any pointers in the exit function will be dereferenced

type CallerHook

type CallerHook struct {
	Field string
	Skip  int
	// contains filtered or unexported fields
}

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 Options

type Options struct {
	File           string // Log everything to this file
	Format         string // Comma separated list of log format options
	UseSyslog      bool   // Use Syslog for logging
	SyslogFacility string // Facility for syslog, eg KERN,USER,...
}

Options contains options for the remote control server

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier