logging

package
v0.0.0-...-eb16ade Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyAppName represents the key for the application name.
	KeyAppName = `app`

	// KeyError represents the key for the error.
	KeyError = `err`

	// KeyStack represents the key for the stack.
	KeyStack = `stack`

	// KeyDal represents the key for the data access layer.
	KeyDal = `dal`

	// KeySupplier represents the key for the supplier.
	KeySupplier = `supplier`

	// KeyHash represents the key for the hash.
	KeyHash = `hash`
)

Variables

This section is empty.

Functions

func CommonLogger

func CommonLogger(cfg *Config) (*slog.Logger, error)

CommonLogger constructs a logging with default options.

func CommonLoggerWithOptions

func CommonLoggerWithOptions(cfg *Config, w io.Writer, minLevel slog.Level, logToJson bool) (*slog.Logger, error)

CommonLoggerWithOptions constructs a logging with custom options.

Types

type AppName

type AppName string

AppName represents the name of the application for the logging.

func (AppName) String

func (n AppName) String() string

String returns the string representation of the AppName.

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is the configuration for the logging.

func NewConfig

func NewConfig(appName AppName) *Config

NewConfig creates a new Config.

Jump to

Keyboard shortcuts

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