logging

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 10 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 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