logging

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package logging contains logging utilities and adapters for various logging libraries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextInterceptor added in v0.15.0

func ContextInterceptor() logging.Logger

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

func NewBadgerAdapter(logger *slog.Logger) badger.Logger

NewBadgerAdapter returns a badger log adapter for the given logger.

func NewBadgerLogger added in v0.7.2

func NewBadgerLogger(logLevel string, format string) badger.Logger

NewBadgerLogger returns a badger log adapter backed by slog with the given log level.

func NewHCLogAdapter

func NewHCLogAdapter(name string, level string, logger *slog.Logger) hclog.Logger

NewHCLogAdapter returns a new hclog adapter.

func NewLogger

func NewLogger(logLevel string, format string) *slog.Logger

NewLogger returns a new logger with the given log level. Format can be one of "text" or "json". If log level is empty or "silent" then the logger will be silent.

func SetupLogging

func SetupLogging(logLevel string, format string) *slog.Logger

SetupLogging sets up logging for the application.

Types

type STUNLoggerFactory

type STUNLoggerFactory struct {
	*slog.Logger
}

func NewSTUNLoggerFactory

func NewSTUNLoggerFactory(logger *slog.Logger) *STUNLoggerFactory

func (*STUNLoggerFactory) NewLogger

func (f *STUNLoggerFactory) NewLogger(scope string) logging.LeveledLogger

Jump to

Keyboard shortcuts

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