log

package
v0.0.0-...-355f379 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: Apache-2.0 Imports: 6 Imported by: 303

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func Critical

func Critical(message string, args ...interface{}) error

func Criticale

func Criticale(err error) error

func Criticalf

func Criticalf(message string, args ...interface{}) error

func Debug

func Debug(message string, args ...interface{}) string

func Debugf

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

func EnableSyslogWriter

func EnableSyslogWriter(tag string) (err error)

EnableSyslogWriter enables, if possible, writes to syslog. These will execute _in addition_ to normal logging

func Error

func Error(message string, args ...interface{}) error

func Errore

func Errore(err error) error

func Errorf

func Errorf(message string, args ...interface{}) error

func Fatal

func Fatal(message string, args ...interface{}) error

Fatal emits a FATAL level entry and exists the program

func Fatale

func Fatale(err error) error

Fatale emits a FATAL level entry and exists the program

func Fatalf

func Fatalf(message string, args ...interface{}) error

Fatalf emits a FATAL level entry and exists the program

func Info

func Info(message string, args ...interface{}) string

func Infof

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

func Notice

func Notice(message string, args ...interface{}) string

func Noticef

func Noticef(message string, args ...interface{}) string

func SetLevel

func SetLevel(logLevel LogLevel)

SetLevel sets the global log level. Only entries with level equals or higher than this value will be logged

func SetPrintStackTrace

func SetPrintStackTrace(shouldPrintStackTrace bool)

SetPrintStackTrace enables/disables dumping the stack upon error logging

func SetSyslogLevel

func SetSyslogLevel(logLevel LogLevel)

SetSyslogLevel sets the minimal syslog level. Only entries with level equals or higher than this value will be logged. However, this is also capped by the global log level. That is, messages with lower level than global-log-level will be discarded at any case.

func Warning

func Warning(message string, args ...interface{}) error

func Warningf

func Warningf(message string, args ...interface{}) error

Types

type LogLevel

type LogLevel int

LogLevel indicates the severity of a log entry

const (
	FATAL LogLevel = iota
	CRITICAL
	ERROR
	WARNING
	NOTICE
	INFO
	DEBUG
)

func GetLevel

func GetLevel() LogLevel

GetLevel returns current global log level

func LogLevelFromString

func LogLevelFromString(logLevelName string) (LogLevel, error)

func (LogLevel) String

func (this LogLevel) String() string

Jump to

Keyboard shortcuts

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