pcmtgit.dotya.ml/mirre-mt/pcmt/slogging Index | Files

package slogging

import "git.dotya.ml/mirre-mt/pcmt/slogging"

Index

Constants

const (
	LevelInfo int = iota
	LevelDebug
	LevelWarn
	LevelError
)

Functions

func Opts

func Opts() *slog.HandlerOptions

Types

type Slogger

type Slogger struct {
	*slog.Logger
}

func Init

func Init(jsonHandler bool) *Slogger

func Logger

func Logger() *Slogger

func SetLevel

func SetLevel(level int) *Slogger

SetLevel allows setting log level and returns the pointer to the re-created logger.

func (*Slogger) Debugf

func (l *Slogger) Debugf(msg string, args ...any)

func (*Slogger) Errorf

func (l *Slogger) Errorf(msg string, args ...any)

func (*Slogger) Infof

func (l *Slogger) Infof(msg string, args ...any)

func (*Slogger) Warnf

func (l *Slogger) Warnf(msg string, args ...any)

Source Files

log.go

Version
v0.0.0-20230910121657-4d10510f5ba4 (latest)
Published
Sep 10, 2023
Platform
linux/amd64
Imports
3 packages
Last checked
1 month ago

Tools for package owners.