Documentation ¶
Index ¶
- func AddRSyslogHook()
- func AddUserHook(deferedHook bool) error
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func FsReady()
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitDeferedLogger()
- func InitLogger()
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func SetDefaultLevel(level Level)
- func SetLevel(level Level)
- func SetOutput(out io.Writer)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- func WithField(key string, value interface{}) *logrus.Entry
- func WithFields(fields Fields) *logrus.Entry
- type Fields
- type Level
- type Logger
- type ShowuserlogHook
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
AddUserHook is used to filter what log messages are written to the screen
func Debug ¶
func Debug(args ...interface{})
func Error ¶
func Error(args ...interface{})
func Fatal ¶
func Fatal(args ...interface{})
func FsReady ¶ added in v1.0.4
func FsReady()
func Info ¶
func Info(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 Panic ¶
func Panic(args ...interface{})
func Print ¶
func Print(args ...interface{})
func Warn ¶
func Warn(args ...interface{})
func Warning ¶
func Warning(args ...interface{})
Types ¶
type 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 )
type ShowuserlogHook ¶
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.