ulog

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 13 Imported by: 3

README

ulog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReplaceFunction

func AddReplaceFunction(fnToBeReplaced string, replaceWithFn string)

func AddReplaceFunctions

func AddReplaceFunctions(m map[string]string)

func AddSkipFunctions

func AddSkipFunctions(_skipFunctions ...string)

func Debug

func Debug(v ...interface{})

func Debugf

func Debugf(fmtString string, v ...interface{})

func Error

func Error(v ...interface{})

func Errorf

func Errorf(fmtString string, v ...interface{})

func Fatal

func Fatal(v ...interface{})

func Fatalf

func Fatalf(fmtString string, v ...interface{})

func Info

func Info(v ...interface{})

func Infof

func Infof(fmtString string, v ...interface{})

func LogEnvStruct

func LogEnvStruct(envStruct interface{}, prefix string)

func LogIfError

func LogIfError(err error)

func LogIfErrorSecondArg

func LogIfErrorSecondArg(_ interface{}, err error)

func LogIfErrorToInfo

func LogIfErrorToInfo(err error)

func LogIfErrorToInfoSecondArg

func LogIfErrorToInfoSecondArg(_ interface{}, err error)

func LogTaggedStructWithMaskingAndWarning

func LogTaggedStructWithMaskingAndWarning(taggedStruct interface{}, tag string, maskTag string, warnTag string, prefix string)

func NewErrorLogger added in v1.0.5

func NewErrorLogger(ulogger *ULogger) *log.Logger

func NewInfoLogger added in v1.0.5

func NewInfoLogger(ulogger *ULogger) *log.Logger

func Panic

func Panic(v ...interface{})

func PanicIfError added in v1.0.3

func PanicIfError(err error)

func PanicIfErrorSecondArg added in v1.0.3

func PanicIfErrorSecondArg(_ interface{}, err error)

func Panicf

func Panicf(fmtString string, v ...interface{})

func RemoveWriter added in v1.0.6

func RemoveWriter(name string) error

Remove a writer

func ReplaceFunctions

func ReplaceFunctions() map[string]string

func SetDebug

func SetDebug()

func SetFormatString

func SetFormatString(_fmtString string)

func SetLogLevel

func SetLogLevel(_level LogLevel)

func SetLogLevelFromString

func SetLogLevelFromString(levelRaw string)

func SetTimestampFormat

func SetTimestampFormat(_tsFormat string)

func SetWriter

func SetWriter(_writer io.Writer, name *string)

Add or replace a writer if name is nil the default writer will be replaced

func SkipFunctions

func SkipFunctions() []string

func Trace

func Trace(v ...interface{})

func Tracef

func Tracef(fmtString string, v ...interface{})

func UnsetDebug

func UnsetDebug()

func Warn

func Warn(v ...interface{})

func Warnf

func Warnf(fmtString string, v ...interface{})

Types

type LogEntry

type LogEntry struct {
	Time     string
	Level    logLevelString
	Package  string
	File     string
	Line     int
	Function string
	Message  string
}

type LogLevel

type LogLevel int
const (
	LEVEL_TRACE LogLevel = iota
	LEVEL_DEBUG
	LEVEL_INFO
	LEVEL_WARNING
	LEVEL_ERROR
	LEVEL_FATAL
)

func GetLogLevel

func GetLogLevel() LogLevel

func LogLevelFromString

func LogLevelFromString(levelRaw string) LogLevel

type UErrorWriter added in v1.0.5

type UErrorWriter struct {
	Logger *ULogger
}

func (UErrorWriter) Write added in v1.0.5

func (l UErrorWriter) Write(p []byte) (n int, err error)

type UInfoWriter added in v1.0.5

type UInfoWriter struct {
	Logger *ULogger
}

func (UInfoWriter) Write added in v1.0.5

func (l UInfoWriter) Write(p []byte) (n int, err error)

type ULog

type ULog struct{}

func NewUlog

func NewUlog() *ULog

func (ULog) Debug

func (l ULog) Debug(v ...interface{})

func (ULog) Debugf

func (l ULog) Debugf(fmtString string, v ...interface{})

func (ULog) Error

func (l ULog) Error(v ...interface{})

func (ULog) Errorf

func (l ULog) Errorf(fmtString string, v ...interface{})

func (ULog) Fatal

func (l ULog) Fatal(v ...interface{})

func (ULog) Fatalf

func (l ULog) Fatalf(fmtString string, v ...interface{})

func (ULog) Info

func (l ULog) Info(v ...interface{})

func (ULog) Infof

func (l ULog) Infof(fmtString string, v ...interface{})

func (ULog) LogIfError

func (l ULog) LogIfError(err error)

func (ULog) LogIfErrorSecondArg

func (l ULog) LogIfErrorSecondArg(tmp interface{}, err error)

func (ULog) LogIfErrorToInfo

func (l ULog) LogIfErrorToInfo(err error)

func (ULog) LogIfErrorToInfoSecondArg

func (l ULog) LogIfErrorToInfoSecondArg(tmp interface{}, err error)

func (ULog) Panic

func (l ULog) Panic(v ...interface{})

func (ULog) PanicIfError added in v1.0.3

func (l ULog) PanicIfError(err error)

func (ULog) PanicIfErrorSecondArg added in v1.0.3

func (l ULog) PanicIfErrorSecondArg(tmp interface{}, err error)

func (ULog) Panicf

func (l ULog) Panicf(fmtString string, v ...interface{})

func (ULog) Trace

func (l ULog) Trace(v ...interface{})

func (ULog) Tracef

func (l ULog) Tracef(fmtString string, v ...interface{})

func (ULog) Warn

func (l ULog) Warn(v ...interface{})

func (ULog) Warnf

func (l ULog) Warnf(fmtString string, v ...interface{})

type ULogger

type ULogger interface {
	Trace(v ...interface{})
	Tracef(fmtString string, v ...interface{})
	Debug(v ...interface{})
	Debugf(fmtString string, v ...interface{})
	Info(v ...interface{})
	Infof(fmtString string, v ...interface{})
	Warn(v ...interface{})
	Warnf(fmtString string, v ...interface{})
	Error(v ...interface{})
	Errorf(fmtString string, v ...interface{})
	Panic(v ...interface{})
	Panicf(fmtString string, v ...interface{})
	Fatal(v ...interface{})
	Fatalf(fmtString string, v ...interface{})
	LogIfError(err error)
	LogIfErrorSecondArg(tmp interface{}, err error)
	PanicIfError(err error)
	PanicIfErrorSecondArg(tmp interface{}, err error)
	LogIfErrorToInfo(err error)
	LogIfErrorToInfoSecondArg(tmp interface{}, err error)
}

Directories

Path Synopsis
otel module

Jump to

Keyboard shortcuts

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