logging

package
v0.0.0-...-a4aa88a Latest Latest
Warning

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

Go to latest
Published: Sep 16, 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.

func GeneralLogger

func GeneralLogger(appName string) error

Types

type Config

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

Config is the configuration for the logging.

func NewConfig

func NewConfig(appName Name) *Config

NewConfig creates a new Config.

type Name

type Name string

Name represents the name of the application for the logging.

func (Name) String

func (n Name) String() string

String returns the string representation of the Name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳