Documentation
¶
Index ¶
- Constants
- Variables
- func AppendLoggableFields(l fmt.Stringer)
- func Debug(ctx context.Context, msg string)
- func Debugf(ctx context.Context, format string, args ...interface{})
- func Error(ctx context.Context, err error, msg string)
- func Errorf(ctx context.Context, err error, format string, args ...interface{})
- func GetLoggableFields() []fmt.Stringer
- func Info(ctx context.Context, msg string)
- func Infof(ctx context.Context, format string, args ...interface{})
- func LevelToUint() uint8
- func Parse(ctx context.Context, scopeLevel string, msg string, err error, fields ...Field) string
- func PreHookSetLogLevel(_ context.Context)
- func SetLevel(l uint8)
- func SetLevelEnvironmentVariable(l string)
- func SetLoggableFields(custom []fmt.Stringer)
- func Trace(ctx context.Context, msg string)
- func Warn(ctx context.Context, msg string)
- func Warnf(ctx context.Context, format string, args ...interface{})
- type ContextField
- type Field
Constants ¶
View Source
const ( ErrorLevelString = "error" WarnLevelString = "warn" InfoLevelString = "info" DebugLevelString = "debug" )
View Source
const ( ErrorLevel uint8 = iota WarnLevel InfoLevel TraceLevel DebugLevel )
Variables ¶
View Source
var LevelEnvironmentVariable = "LOG_LEVEL"
LevelEnvironmentVariable get the level of logging
Functions ¶
func AppendLoggableFields ¶ added in v0.1.2
func GetLoggableFields ¶ added in v0.1.2
func LevelToUint ¶
func LevelToUint() uint8
func PreHookSetLogLevel ¶ added in v0.1.3
func SetLevelEnvironmentVariable ¶ added in v0.1.1
func SetLevelEnvironmentVariable(l string)
func SetLoggableFields ¶
Types ¶
type ContextField ¶
type ContextField string
const ( TracingTime ContextField = "tracing_time" UserID ContextField = "user_id" ClientHost ContextField = "client_host" CorrelationID ContextField = "correlation_id" HTTPPath ContextField = "http_path" )
func (ContextField) String ¶
func (c ContextField) String() string
Click to show internal directories.
Click to hide internal directories.