Documentation
¶
Index ¶
- func Configure(opts ...Option)
- func DPanic(v ...interface{})
- func DPanicf(template string, v ...interface{})
- func Debug(v ...interface{})
- func DebugIfError(err error)
- func DebugStruct(taggedStruct interface{}, prefix string)
- func Debugf(template string, v ...interface{})
- func Error(v ...interface{})
- func ErrorStruct(taggedStruct interface{}, prefix string)
- func Errorf(template string, v ...interface{})
- func Fatal(v ...interface{})
- func FatalIfError(err error)
- func FatalIfErrorSecondArg(input interface{}, err error) interface{}
- func Fatalf(template string, v ...interface{})
- func Info(v ...interface{})
- func InfoIfError(err error)
- func InfoStruct(taggedStruct interface{}, prefix string)
- func Infof(template string, v ...interface{})
- func L() *zap.Logger
- func Log(lvl zapcore.Level, msg string, fields ...zapcore.Field)
- func LogByteArrayLineByLine(in []byte, f func(string, ...interface{}), prefix ...string)
- func LogByteArrayLineByLineToDebug(in []byte, prefix ...string)
- func LogByteArrayLineByLineToError(in []byte, prefix ...string)
- func LogByteArrayLineByLineToInfo(in []byte, prefix ...string)
- func LogByteArrayLineByLineToWarn(in []byte, prefix ...string)
- func LogEnvStruct(envStruct interface{}, prefix string)
- func LogIfError(err error)
- func LogIfErrorSecondArg(input interface{}, err error) interface{}
- func LogIfErrorToInfo(err error)
- func LogIfErrorToInfoSecondArg(_ interface{}, err error)
- func LogJSONStruct(envStruct interface{}, prefix string)
- func LogTaggedStructWithMaskingAndWarning(taggedStruct interface{}, tag string, maskTag string, warnTag string, ...)
- func Panic(v ...interface{})
- func PanicIfError(err error)
- func PanicIfErrorSecondArg(input interface{}, err error) interface{}
- func Panicf(template string, v ...interface{})
- func S() *zap.SugaredLogger
- func SkipOneL() *zap.Logger
- func SkipOneS() *zap.SugaredLogger
- func Trace(v ...interface{})
- func TraceIfError(err error)
- func TraceStruct(taggedStruct interface{}, prefix string)
- func Tracef(template string, v ...interface{})
- func Warn(v ...interface{})
- func WarnIfError(err error)
- func WarnStruct(taggedStruct interface{}, prefix string)
- func Warnf(template string, v ...interface{})
- type DebugWriter
- type ErrorWriter
- type FatalWriter
- type InfoWriter
- type Logger
- func (l Logger) DPanic(v ...interface{})
- func (l Logger) DPanicf(template string, v ...interface{})
- func (l Logger) Debug(v ...interface{})
- func (l Logger) Debugf(template string, v ...interface{})
- func (l Logger) Error(v ...interface{})
- func (l Logger) Errorf(template string, v ...interface{})
- func (l Logger) Fatal(v ...interface{})
- func (l Logger) Fatalf(template string, v ...interface{})
- func (l Logger) Fatalln(v ...interface{})
- func (l Logger) Info(v ...interface{})
- func (l Logger) Infof(template string, v ...interface{})
- func (l Logger) Panic(v ...interface{})
- func (l Logger) Panicf(template string, v ...interface{})
- func (l Logger) Panicln(v ...interface{})
- func (l Logger) Print(v ...interface{})
- func (l Logger) Printf(format string, v ...interface{})
- func (l Logger) Println(v ...interface{})
- func (l Logger) Trace(v ...interface{})
- func (l Logger) Tracef(template string, v ...interface{})
- func (l Logger) Warn(v ...interface{})
- func (l Logger) Warnf(template string, v ...interface{})
- type Option
- func WithAdditionalCores(cores ...zapcore.Core) Option
- func WithCallerFieldWidth(fieldWidth int) Option
- func WithIsDevelopment(isDevelopment bool) Option
- func WithLogLevel(lvl string) Option
- func WithNewlineReplacement(newlineReplacement string) Option
- func WithRedirectOutput(w io.Writer) Option
- func WithRenderDummyThread(renderDummyThread bool) Option
- func WithStripAdditionalFields(stripAdditionalFields bool) Option
- type PanicWriter
- type TraceWriter
- type WarnWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugStruct ¶
func DebugStruct(taggedStruct interface{}, prefix string)
Log out a struct line by line to Debug
func ErrorStruct ¶
func ErrorStruct(taggedStruct interface{}, prefix string)
Log out a struct line by line to Error
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 InfoStruct ¶
func InfoStruct(taggedStruct interface{}, prefix string)
Log out a struct line by line to Info
func LogByteArrayLineByLine ¶
Logs a byteArray line by line
func LogByteArrayLineByLineToDebug ¶
Logs a byteArray line by line to Debug
func LogByteArrayLineByLineToError ¶
Logs a byteArray line by line to Error
func LogByteArrayLineByLineToInfo ¶
Logs a byteArray line by line to Info
func LogByteArrayLineByLineToWarn ¶
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 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 LogTaggedStructWithMaskingAndWarning ¶
func LogTaggedStructWithMaskingAndWarning( taggedStruct interface{}, tag string, maskTag string, warnTag string, prefix string, printHeaders bool, logger *zap.SugaredLogger, )
Helper function to log out a struct should only be used if LogEnvStruct() or LogJSONStruct() do not meet your requirements
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 S ¶
func S() *zap.SugaredLogger
func SkipOneS ¶
func SkipOneS() *zap.SugaredLogger
func TraceStruct ¶
func TraceStruct(taggedStruct interface{}, prefix string)
Log out a struct line by line to Trace
func WarnStruct ¶
func WarnStruct(taggedStruct interface{}, prefix string)
Log out a struct line by line to Warn
Types ¶
type DebugWriter ¶
type DebugWriter struct{}
type ErrorWriter ¶
type ErrorWriter struct{}
type FatalWriter ¶
type FatalWriter struct{}
type InfoWriter ¶
type InfoWriter struct{}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
convenience for passing the logger to third-party libs wip, methods might need to be added
func NewDefaultLogger ¶
func NewDefaultLogger() Logger
func NewLogger ¶
func NewLogger(log *zap.SugaredLogger) Logger
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithAdditionalCores ¶
func WithCallerFieldWidth ¶
func WithIsDevelopment ¶
func WithLogLevel ¶
func WithNewlineReplacement ¶ added in v2.1.7
func WithRedirectOutput ¶
func WithRenderDummyThread ¶
type PanicWriter ¶
type PanicWriter struct{}
type TraceWriter ¶
type TraceWriter struct{}
type WarnWriter ¶
type WarnWriter struct{}