Documentation ¶
Overview ¶
Package logging contains logging utilities and adapters for various logging libraries.
Index ¶
- func ContextInterceptor() logging.Logger
- func ContextStreamServerInterceptor() grpc.StreamServerInterceptor
- func ContextUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func NewBadgerAdapter(logger *slog.Logger) badger.Logger
- func NewBadgerLogger(logLevel string, format string) badger.Logger
- func NewHCLogAdapter(name string, level string, logger *slog.Logger) hclog.Logger
- func NewLogger(logLevel string, format string) *slog.Logger
- func SetupLogging(logLevel string, format string) *slog.Logger
- type STUNLoggerFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextInterceptor ¶ added in v0.15.0
ContextInterceptor returns a logging.Logger that logs to the logger provided in the context.
func ContextStreamServerInterceptor ¶ added in v0.15.0
func ContextStreamServerInterceptor() grpc.StreamServerInterceptor
ContextLogCallsStreamServerInterceptor returns a grpc.UnaryServerInterceptor that logs to the given logger.
func ContextUnaryServerInterceptor ¶ added in v0.15.0
func ContextUnaryServerInterceptor() grpc.UnaryServerInterceptor
ContextUnaryServerInterceptor returns a grpc.UnaryServerInterceptor that logs to the given logger.
func NewBadgerAdapter ¶ added in v0.7.2
NewBadgerAdapter returns a badger log adapter for the given logger.
func NewBadgerLogger ¶ added in v0.7.2
NewBadgerLogger returns a badger log adapter backed by slog with the given log level.
func NewHCLogAdapter ¶
NewHCLogAdapter returns a new hclog adapter.
Types ¶
type STUNLoggerFactory ¶
func NewSTUNLoggerFactory ¶
func NewSTUNLoggerFactory(logger *slog.Logger) *STUNLoggerFactory
func (*STUNLoggerFactory) NewLogger ¶
func (f *STUNLoggerFactory) NewLogger(scope string) logging.LeveledLogger
Click to show internal directories.
Click to hide internal directories.