v2

package module
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(opts ...Option)

func DPanic

func DPanic(v ...interface{})

func DPanicf

func DPanicf(template string, v ...interface{})

func Debug

func Debug(v ...interface{})

func DebugIfError

func DebugIfError(err error)

Logs the error to DEBUG-level if is not nil

func Debugf

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

func Error

func Error(v ...interface{})

func Errorf

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

func Fatal

func Fatal(v ...interface{})

func FatalIfError

func FatalIfError(err error)

Logs the error to FATAL-level if is not nil

func FatalIfErrorSecondArg

func FatalIfErrorSecondArg(input interface{}, err error) interface{}

Logs if error received as second argument to FATAL-level (and panicking after) is not nil (first argument is discarded)

func Fatalf

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

func Info

func Info(v ...interface{})

func InfoIfError

func InfoIfError(err error)

Logs the error to INFO-level if is not nil

func Infof

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

func L

func L() *zap.Logger

func Log added in v2.0.2

func Log(lvl zapcore.Level, msg string, fields ...zapcore.Field)

func LogByteArrayLineByLine

func LogByteArrayLineByLine(in []byte, f func(string, ...interface{}), prefix ...string)

Logs a byteArray line by line

func LogByteArrayLineByLineToDebug

func LogByteArrayLineByLineToDebug(in []byte, prefix ...string)

Logs a byteArray line by line to Debug

func LogByteArrayLineByLineToError

func LogByteArrayLineByLineToError(in []byte, prefix ...string)

Logs a byteArray line by line to Error

func LogByteArrayLineByLineToInfo

func LogByteArrayLineByLineToInfo(in []byte, prefix ...string)

Logs a byteArray line by line to Info

func LogByteArrayLineByLineToWarn

func LogByteArrayLineByLineToWarn(in []byte, prefix ...string)

Logs a byteArray line by line to Warn

func LogEnvStruct

func LogEnvStruct(envStruct interface{}, prefix string)

Helper function to log out a struct annotated with "env", "mask" and "warnIf" annotations Good to use with the "github.com/codingconcepts/env" package

func LogIfError

func LogIfError(err error)

Logs the error to ERROR-level if it is not nil

func LogIfErrorSecondArg

func LogIfErrorSecondArg(input interface{}, err error) interface{}

Logs if error received as second argument to ERROR-level is not nil (first argument is discarded)

func LogIfErrorToInfo

func LogIfErrorToInfo(err error)

Logs the error to INFO-level if it is not nil

func LogIfErrorToInfoSecondArg

func LogIfErrorToInfoSecondArg(_ interface{}, err error)

Logs if error received as second argument to INFO-level is not nil (first argument is discarded)

func LogJSONStruct

func LogJSONStruct(envStruct interface{}, prefix string)

Helper function to log out a struct annotated with "json", "mask" and "warnIf" annotations Good to use with the "encoding/json" package

func Panic

func Panic(v ...interface{})

func PanicIfError

func PanicIfError(err error)

Logs the error to PANIC-level (and panicking after) if is not nil

func PanicIfErrorSecondArg

func PanicIfErrorSecondArg(input interface{}, err error) interface{}

Logs if error received as second argument to PANIC-level (and panicking after) is not nil (first argument is discarded)

func Panicf

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

func S

func S() *zap.SugaredLogger

func SkipOneL added in v2.0.2

func SkipOneL() *zap.Logger

func SkipOneS added in v2.0.2

func SkipOneS() *zap.SugaredLogger

func Trace

func Trace(v ...interface{})

func TraceIfError

func TraceIfError(err error)

Logs the error to TRACE-level if is not nil

func Tracef

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

func Warn

func Warn(v ...interface{})

func WarnIfError

func WarnIfError(err error)

Logs the error to WARN-level if is not nil

func Warnf

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

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithCallerFieldWidth

func WithCallerFieldWidth(fieldWidth int) Option

func WithIsDevelopment

func WithIsDevelopment(isDevelopment bool) Option

func WithLogLevel

func WithLogLevel(lvl string) Option

func WithRenderDummyThread added in v2.0.1

func WithRenderDummyThread(renderDummyThread bool) Option

func WithStripAdditionalFields

func WithStripAdditionalFields(stripAdditionalFields bool) Option

Jump to

Keyboard shortcuts

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