errorlogs

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(out logs.Logger) logs.Logger

NewLogger creates a new logs.Logger.

func NewLoggerWithOption

func NewLoggerWithOption(out logs.Logger, opt LoggerOption) logs.Logger

NewLoggerWithOption creates a new logs.Logger with the given option.

Types

type LoggerOption

type LoggerOption struct {
	// StackTraceLogLevel is the log level for stack trace.
	StackTraceLogLevel StackTraceLogLevel
	// PrintStackTraceOnWarn is whether to print stack trace on Warn.
	PrintStackTraceOnWarn bool
	// PrintCurrentStackTraceIfNotAttached is whether to print the current stack trace if the error does not have a stack trace.
	PrintCurrentStackTraceIfNotAttached bool
}

LoggerOption is the option for logger implementation.

type StackTraceLogLevel

type StackTraceLogLevel int8

StackTraceLogLevel is the log level for stack trace.

const (
	// StackTraceLogLevelDebug indicates that the stack trace will be logged as a debug level.
	StackTraceLogLevelDebug StackTraceLogLevel = iota
	// StackTraceLogLevelInfo indicates that the stack trace will be logged as an info level.
	StackTraceLogLevelInfo
	// StackTraceLogLevelWarn indicates that the stack trace will be logged as a warn level.
	StackTraceLogLevelWarn
	// StackTraceLogLevelError indicates that the stack trace will be logged as an error level.
	StackTraceLogLevelError
)

Jump to

Keyboard shortcuts

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