Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 )
Click to show internal directories.
Click to hide internal directories.