log

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRSyslogHook added in v1.1.0

func AddRSyslogHook()

AddRSyslogHook only needs to be called separately when using the InitDeferedLogger init.Main can't read /proc/cmdline at start. and then fails due to the network not being up TODO: create a "defered SyslogHook that always gets initialised, but if it fails to connect, stores the logs

and retries connecting every time its triggered....

func AddUserHook added in v1.0.4

func AddUserHook(deferedHook bool) error

AddUserHook is used to filter what log messages are written to the screen

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func FsReady added in v1.0.4

func FsReady()

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func InitDeferedLogger added in v1.0.4

func InitDeferedLogger()

InitDeferedLogger stores the log messages until FsReady() is called TODO: actually store them :) TODO: need to work out how to pass entries from a binary run before we switchfs back to init and have it store and write it later

func InitLogger

func InitLogger()

InitLogger sets up Logging to log to /dev/kmsg and to Syslog

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(format string, args ...interface{})

func Print

func Print(args ...interface{})

func Printf

func Printf(format string, args ...interface{})

func SetDefaultLevel added in v1.0.4

func SetDefaultLevel(level Level)

func SetLevel

func SetLevel(level Level)

func SetOutput

func SetOutput(out io.Writer)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

func Warning

func Warning(args ...interface{})

func Warningf

func Warningf(format string, args ...interface{})

func WithField

func WithField(key string, value interface{}) *logrus.Entry

func WithFields

func WithFields(fields Fields) *logrus.Entry

Types

type Fields

type Fields logrus.Fields

type Level

type Level logrus.Level
const (
	// PanicLevel level, highest level of severity. Logs and then calls panic with the
	// message passed to Debug, Info, ...
	PanicLevel Level = iota
	// FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FatalLevel
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ErrorLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	InfoLevel
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
)

func GetLevel

func GetLevel() Level

type Logger

type Logger logrus.Logger

type ShowuserlogHook

type ShowuserlogHook struct {
	Level logrus.Level
	// contains filtered or unexported fields
}

ShowuserlogHook stores all levels of logrus entries in memory until its told the RancherOS logging system is ready then it replays them to be logged

func NewShowuserlogHook

func NewShowuserlogHook(l logrus.Level, app string) (*ShowuserlogHook, error)

NewShowuserlogHook creates a new hook for use

func (*ShowuserlogHook) Fire

func (hook *ShowuserlogHook) Fire(entry *logrus.Entry) error

Fire is called by logrus when the Hook is active

func (*ShowuserlogHook) Levels

func (hook *ShowuserlogHook) Levels() []logrus.Level

Levels returns all log levels, so we can process them ourselves

func (*ShowuserlogHook) NotUsedYetLogSystemReady added in v1.0.4

func (hook *ShowuserlogHook) NotUsedYetLogSystemReady() error

NotUsedYetLogSystemReady Set up Syslog Hook, and replay any stored entries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL