Documentation ¶
Index ¶
- Constants
- func AddToLoggingContext(ctx context.Context, label string, value any) context.Context
- type ContextLogger
- func (l ContextLogger) Debug() Entry
- func (l ContextLogger) Error() Entry
- func (l ContextLogger) New(name string) Logger
- func (l ContextLogger) Trace() Entry
- func (l ContextLogger) WithCtx(ctx context.Context) Logger
- func (l ContextLogger) WithError(err error) Logger
- func (l ContextLogger) WithField(key string, v any) Logger
- type DevNullLogger
- func (d DevNullLogger) Debug() Entry
- func (d DevNullLogger) Error() Entry
- func (d DevNullLogger) New(name string) Logger
- func (d DevNullLogger) Trace() Entry
- func (d DevNullLogger) WithCtx(ctx context.Context) Logger
- func (d DevNullLogger) WithError(err error) Logger
- func (d DevNullLogger) WithField(key string, v any) Logger
- type DevNullLoggingSystem
- type Entry
- type Level
- type Logger
- type LoggingContext
- type LoggingSystem
- type LoggingSystemEntry
- type LogrusLoggingSystem
- type TestingLoggingSystem
- type ZerologLoggingSystem
Constants ¶
View Source
const ( PeerIdContextLabel = "ctx.peer_id" ConnectionIdContextLabel = "ctx.connection_id" // StreamIdContextLabel is used to store stream ids which are request numbers interpreted so that // streams initiated by us have positive numbers and streams initiated by remote have negative numbers. StreamIdContextLabel = "ctx.stream_id" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextLogger ¶
type ContextLogger struct {
// contains filtered or unexported fields
}
func (ContextLogger) Debug ¶
func (l ContextLogger) Debug() Entry
func (ContextLogger) Error ¶
func (l ContextLogger) Error() Entry
func (ContextLogger) New ¶
func (l ContextLogger) New(name string) Logger
func (ContextLogger) Trace ¶
func (l ContextLogger) Trace() Entry
func (ContextLogger) WithError ¶
func (l ContextLogger) WithError(err error) Logger
type DevNullLogger ¶
type DevNullLogger struct { }
func NewDevNullLogger ¶
func NewDevNullLogger() DevNullLogger
func (DevNullLogger) Debug ¶
func (d DevNullLogger) Debug() Entry
func (DevNullLogger) Error ¶
func (d DevNullLogger) Error() Entry
func (DevNullLogger) New ¶
func (d DevNullLogger) New(name string) Logger
func (DevNullLogger) Trace ¶
func (d DevNullLogger) Trace() Entry
func (DevNullLogger) WithError ¶
func (d DevNullLogger) WithError(err error) Logger
type DevNullLoggingSystem ¶
type DevNullLoggingSystem struct { }
func NewDevNullLoggingSystem ¶
func NewDevNullLoggingSystem() DevNullLoggingSystem
func (DevNullLoggingSystem) Debug ¶
func (d DevNullLoggingSystem) Debug() LoggingSystemEntry
func (DevNullLoggingSystem) EnabledLevel ¶ added in v0.0.2
func (d DevNullLoggingSystem) EnabledLevel() Level
func (DevNullLoggingSystem) Error ¶
func (d DevNullLoggingSystem) Error() LoggingSystemEntry
func (DevNullLoggingSystem) Trace ¶
func (d DevNullLoggingSystem) Trace() LoggingSystemEntry
type Logger ¶
type Logger interface { New(name string) Logger WithCtx(ctx context.Context) Logger WithError(err error) Logger WithField(key string, v any) Logger Error() Entry Debug() Entry Trace() Entry }
func NewContextLogger ¶
func NewContextLogger(logger LoggingSystem, name string) Logger
type LoggingContext ¶
func GetLoggingContext ¶
func GetLoggingContext(ctx context.Context) LoggingContext
type LoggingSystem ¶
type LoggingSystem interface { EnabledLevel() Level Error() LoggingSystemEntry Debug() LoggingSystemEntry Trace() LoggingSystemEntry }
type LoggingSystemEntry ¶ added in v0.0.2
type LoggingSystemEntry interface { WithField(key string, v any) LoggingSystemEntry Message(msg string) }
type LogrusLoggingSystem ¶
type LogrusLoggingSystem struct {
// contains filtered or unexported fields
}
func NewLogrusLoggingSystem ¶
func NewLogrusLoggingSystem(logger *logrus.Logger) LogrusLoggingSystem
func (LogrusLoggingSystem) Debug ¶
func (l LogrusLoggingSystem) Debug() LoggingSystemEntry
func (LogrusLoggingSystem) EnabledLevel ¶ added in v0.0.2
func (t LogrusLoggingSystem) EnabledLevel() Level
func (LogrusLoggingSystem) Error ¶
func (l LogrusLoggingSystem) Error() LoggingSystemEntry
func (LogrusLoggingSystem) Trace ¶
func (l LogrusLoggingSystem) Trace() LoggingSystemEntry
type TestingLoggingSystem ¶ added in v0.0.2
type TestingLoggingSystem struct {
// contains filtered or unexported fields
}
func NewTestingLoggingSystem ¶ added in v0.0.2
func NewTestingLoggingSystem(tb testing.TB) *TestingLoggingSystem
func (TestingLoggingSystem) Debug ¶ added in v0.0.2
func (t TestingLoggingSystem) Debug() LoggingSystemEntry
func (TestingLoggingSystem) EnabledLevel ¶ added in v0.0.2
func (t TestingLoggingSystem) EnabledLevel() Level
func (TestingLoggingSystem) Error ¶ added in v0.0.2
func (t TestingLoggingSystem) Error() LoggingSystemEntry
func (TestingLoggingSystem) Trace ¶ added in v0.0.2
func (t TestingLoggingSystem) Trace() LoggingSystemEntry
type ZerologLoggingSystem ¶ added in v0.0.2
type ZerologLoggingSystem struct {
// contains filtered or unexported fields
}
func NewZerologLoggingSystem ¶ added in v0.0.2
func NewZerologLoggingSystem(logger zerolog.Logger) ZerologLoggingSystem
func (ZerologLoggingSystem) Debug ¶ added in v0.0.2
func (l ZerologLoggingSystem) Debug() LoggingSystemEntry
func (ZerologLoggingSystem) EnabledLevel ¶ added in v0.0.2
func (t ZerologLoggingSystem) EnabledLevel() Level
func (ZerologLoggingSystem) Error ¶ added in v0.0.2
func (l ZerologLoggingSystem) Error() LoggingSystemEntry
func (ZerologLoggingSystem) Trace ¶ added in v0.0.2
func (l ZerologLoggingSystem) Trace() LoggingSystemEntry
Click to show internal directories.
Click to hide internal directories.