log

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	LOG_LEVEL_TRACE     LogLevel = 401
	LOG_LEVEL_DEBUG     LogLevel = 400
	LOG_LEVEL_INFO      LogLevel = 300
	LOG_LEVEL_WARN      LogLevel = 200
	LOG_LEVEL_ERROR     LogLevel = 100
	LOG_LEVEL_EMERGENCY LogLevel = -1
	LOG_LEVEL_FATAL     LogLevel = -2
	LOG_LEVEL_DISRUPT   LogLevel = -999
	DEFAULT_SKIP        int      = 3
	DEFAULT_LOG_LEVEL   LogLevel = LOG_LEVEL_INFO
)

Variables

View Source
var (
	SetWriter   = log.SetOutput
	TraceOutput = func(values []interface{}, filePath FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(filePath), " / ", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	DebugOutput = func(values []interface{}, filePath FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(filePath), " / ", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	InfoOutput = func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	WarnOutput = func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	ErrorOutput = func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	EmergencyOutput = func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	FatalOutput = func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
	DisruptOutput = func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string {
		return []string{"[", string(name), "]: ", strings.Join(InterfacesToStrings(values), " ")}
	}
)

Functions

func Debug

func Debug(values ...interface{})

func Disrupt

func Disrupt(values ...interface{})

func Emergency

func Emergency(values ...interface{})

func Error

func Error(values ...interface{})

func Fatal

func Fatal(values ...interface{})

func Info

func Info(values ...interface{})

func InterfacesToStrings

func InterfacesToStrings(arg []interface{}) []string

func SetFunctionSkip

func SetFunctionSkip(_skip int)

func SetLevel

func SetLevel(level LogLevel)

func SetLevelOrDefault

func SetLevelOrDefault(level interface{}, defaultLevel LogLevel)

func Trace

func Trace(values ...interface{})

func Warn

func Warn(values ...interface{})

Types

type FilePath

type FilePath string

type LogLevel

type LogLevel int

func GetLevel

func GetLevel() LogLevel

func ParseLevel

func ParseLevel(level string) (LogLevel, error)

type MethodName

type MethodName string

type OutputFunc added in v0.0.4

type OutputFunc func(values []interface{}, _ FilePath, line ProgramLine, name MethodName) []string

type ProgramLine

type ProgramLine int

Jump to

Keyboard shortcuts

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