logger

package
v0.0.0-...-18aef32 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogLevelTrace outputs TRACE, DEBUG, INFO, WARNING, ERROR, and PANIC logs
	LogLevelTrace = "TRACE"
	// LogLevelDebug outputs DEBUG, INFO, WARNING, ERROR, and PANIC logs
	LogLevelDebug = "DEBUG"
	// LogLevelInfo outputs INFO, WARNING, ERROR, and PANIC logs
	LogLevelInfo = "INFO"
	// LogLevelWarning outputs WARNING, ERROR, and PANIC logs
	LogLevelWarning = "WARNING"
	// LogLevelError outputs ERROR and PANIC logs
	LogLevelError = "ERROR"
	// LogLevelPanic outputs PANIC logs only
	LogLevelPanic = "PANIC"
)

Variables

This section is empty.

Functions

func Debug

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

Debug prints debug message to logs

func DebugContext

func DebugContext(ctx context.Context, format string, v ...interface{})

DebugContext prints debug message to logs

func Err

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

Err prints error message to logs

func ErrContext

func ErrContext(ctx context.Context, format string, v ...interface{})

ErrContext prints error message to logs

func ErrNoStack

func ErrNoStack(format string, v ...interface{})

ErrNoStack prints error message to logs without stacktrace

func ErrNoStackContext

func ErrNoStackContext(ctx context.Context, format string, v ...interface{})

ErrNoStackContext prints error message to logs without stacktrace

func Fatal

func Fatal(format string, v ...interface{})

Fatal calls Err and then os.Exit(1)

func FatalContext

func FatalContext(ctx context.Context, format string, v ...interface{})

FatalContext calls Err and then os.Exit(1)

func Info

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

Info prints info message to logs

func InfoContext

func InfoContext(ctx context.Context, format string, v ...interface{})

InfoContext prints info message to logs

func Panic

func Panic(format string, v ...interface{})

Panic prints panic message to logs

func PanicContext

func PanicContext(ctx context.Context, format string, v ...interface{})

PanicContext prints panic message to logs

func SetupLogger

func SetupLogger(ptHost string, ptPort string)

SetupLogger creates logger instance to log to PaperTrail and Console. Should only called once in main function.

func SetupLoggerAuto

func SetupLoggerAuto(appName string, ptEndpoint string)

SetupLoggerAuto creates logger instance to log to PaperTrail automatically without specifying PT HOST and PORT

func Trace

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

Trace prints trace message to logs

func TraceContext

func TraceContext(ctx context.Context, format string, v ...interface{})

TraceContext prints trace message to logs

func Warn

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

Warn prints warning message to logs

func WarnContext

func WarnContext(ctx context.Context, format string, v ...interface{})

WarnContext prints warning message to logs

Types

This section is empty.

Jump to

Keyboard shortcuts

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