logger

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LogLevelAlert = 1

LogLevelAlert = stdlog.h/LOG_ALERT

View Source
const LogLevelCrit = 2

LogLevelCrit = stdlog.h/LOG_CRIT

View Source
const LogLevelDebug = 7

LogLevelDebug = stdlog.h/LOG_DEBUG

View Source
const LogLevelEmerg = 0

LogLevelEmerg = stdlog.h/LOG_EMERG

View Source
const LogLevelErr = 3

LogLevelErr = stdlog.h/LOG_ERR

View Source
const LogLevelInfo = 6

LogLevelInfo = stdlog.h/LOG_INFO

View Source
const LogLevelNotice = 5

LogLevelNotice = stdlog.h/LOG_NOTICE

View Source
const LogLevelTrace = 8

LogLevelTrace = custom value

View Source
const LogLevelWarn = 4

LogLevelWarn = stdlog.h/LOG_WARNING

Variables

This section is empty.

Functions

func Alert

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

Alert is called for log level ALERT messages

func Crit

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

Crit is called for log level CRIT messages

func Debug

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

Debug is called for log level DEBUG messages

func DisableTimestamp added in v0.1.2

func DisableTimestamp()

DisableTimestamp disable the elapsed time in output

func Emerg

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

Emerg is called for log level EMERG messages

func EnableTimestamp added in v0.1.2

func EnableTimestamp()

EnableTimestamp enables the elapsed time in output

func Err

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

Err is called for log level ERR messages

func GetLogLevel added in v0.1.2

func GetLogLevel(source string, altsource string) int

GetLogLevel returns the log level for the specified source(s) it uses altsource only if a specification for source is not found

func Info

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

Info is called for log level INFO messages

func IsAlertEnabled

func IsAlertEnabled() bool

IsAlertEnabled returns true if ALERT logging is enable for the caller

func IsCritEnabled

func IsCritEnabled() bool

IsCritEnabled returns true if CRIT logging is enable for the caller

func IsDebugEnabled

func IsDebugEnabled() bool

IsDebugEnabled returns true if DEBUG logging is enable for the caller

func IsEmergEnabled

func IsEmergEnabled() bool

IsEmergEnabled returns true if EMERG logging is enable for the caller

func IsErrEnabled

func IsErrEnabled() bool

IsErrEnabled returns true if ERR logging is enable for the caller

func IsInfoEnabled

func IsInfoEnabled() bool

IsInfoEnabled returns true if INFO logging is enable for the caller

func IsLogEnabled

func IsLogEnabled(level int) bool

IsLogEnabled returns true if logging is enabled for the caller at the specified level, false otherwise

func IsLogEnabledSource added in v0.1.2

func IsLogEnabledSource(level int, source string) bool

IsLogEnabledSource is the same as IsLogEnabled but for the manually specified source

func IsNoticeEnabled

func IsNoticeEnabled() bool

IsNoticeEnabled returns true if NOTICE logging is enable for the caller

func IsTraceEnabled

func IsTraceEnabled() bool

IsTraceEnabled returns true if TRACE logging is enable for the caller

func IsWarnEnabled

func IsWarnEnabled() bool

IsWarnEnabled returns true if WARN logging is enable for the caller

func LogFormatter added in v0.1.2

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

LogFormatter creats a log message using the format and arguments provided We look for and handle special format verbs that trigger additional processing

func LogMessage

func LogMessage(level int, format string, args ...interface{})

LogMessage is called to write messages to the system log

func LogMessageSource

func LogMessageSource(level int, source string, format string, args ...interface{})

LogMessageSource is similar to LogMessage except instead of using runtime to determine the caller/source the source is specified manually

func Notice

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

Notice is called for log level NOTICE messages

func Shutdown

func Shutdown()

Shutdown stops the logging service

func Startup

func Startup()

Startup starts the logging service

func Trace

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

Trace is called for log level TRACE messages

func Warn

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

Warn is called for log level WARN messages

Types

type LogWriter

type LogWriter struct {
	// contains filtered or unexported fields
}

LogWriter is used to send an output stream to the Log facility

func NewLogWriter

func NewLogWriter() *LogWriter

NewLogWriter creates an io Writer to steam output to the Log facility

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (int, error)

Write takes written data and stores it in a buffer and writes to the log when a line feed is detected

Jump to

Keyboard shortcuts

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