Documentation
¶
Index ¶
- func ContextWithID(ctx context.Context, id ID) context.Context
- func ContextWithNewID(ctx context.Context) context.Context
- func ContextWithOverrideLevel(ctx context.Context, level Level) context.Context
- func Debug(args ...any)
- func DebugContext(ctx context.Context, args ...any)
- func Error(args ...any)
- func ErrorContext(ctx context.Context, args ...any)
- func Fatal(args ...any)
- func FatalContext(ctx context.Context, args ...any)
- func FormatDuration(duration time.Duration) string
- func FormatLevel(level Level) string
- func Info(args ...any)
- func InfoContext(ctx context.Context, args ...any)
- func Panic(args ...any)
- func PanicContext(ctx context.Context, args ...any)
- func SetStdLogger(logger ContextLogger)
- func Trace(args ...any)
- func TraceContext(ctx context.Context, args ...any)
- func Warn(args ...any)
- func WarnContext(ctx context.Context, args ...any)
- type ContextLogger
- type Entry
- type Factory
- type Formatter
- type ID
- type Level
- type Logger
- type ObservableFactory
- type Options
- type PlatformWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithID ¶ added in v1.11.6
func DebugContext ¶
func ErrorContext ¶
func FatalContext ¶
func FormatDuration ¶ added in v1.10.0
func FormatLevel ¶
func InfoContext ¶
func PanicContext ¶
func SetStdLogger ¶ added in v1.2.0
func SetStdLogger(logger ContextLogger)
func TraceContext ¶
func WarnContext ¶
Types ¶
type ContextLogger ¶
type ContextLogger logger.ContextLogger
func StdLogger ¶
func StdLogger() ContextLogger
type Factory ¶
type Factory interface {
Start() error
Close() error
Level() Level
SetLevel(level Level)
Logger() ContextLogger
NewLogger(tag string) ContextLogger
}
type Formatter ¶
type Formatter struct {
BaseTime time.Time
DisableColors bool
DisableTimestamp bool
FullTimestamp bool
TimestampFormat string
DisableLineBreak bool
}
type ObservableFactory ¶
type ObservableFactory interface {
Factory
observable.Observable[Entry]
}
func NewDefaultFactory ¶ added in v1.8.0
func NewDefaultFactory( ctx context.Context, formatter Formatter, writer io.Writer, filePath string, platformWriter PlatformWriter, needObservable bool, ) ObservableFactory
func NewNOPFactory ¶
func NewNOPFactory() ObservableFactory
type Options ¶ added in v1.2.3
type Options struct {
Context context.Context
Options option.LogOptions
Observable bool
DefaultWriter io.Writer
BaseTime time.Time
PlatformWriter PlatformWriter
}
type PlatformWriter ¶ added in v1.6.5
Click to show internal directories.
Click to hide internal directories.