internal

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KEY_TIMESTAMP = "@ts"
	KEY_LEVEL     = "@lv"
	KEY_MESSAGE   = "@msg"
	KEY_SOURCE    = "@src"
)
View Source
const (
	// TIME_FORMAT timestamp format
	TIME_FORMAT = "20060102-150405.000"
	// MASKED used to mask sensitive content
	MASKED = "--masked--"
)
View Source
const (
	BadKey       = "!BADKEY"
	MissingValue = "!MISSINGVALUE"
)
View Source
const (
	LogLevelDebug = LogLevel(slog.LevelDebug)
	LogLevelInfo  = LogLevel(slog.LevelInfo)
	LogLevelWarn  = LogLevel(slog.LevelWarn)
	LogLevelError = LogLevel(slog.LevelError)
)

Variables

This section is empty.

Functions

func NawStdLogger

func NawStdLogger(w io.Writer, skip int, lv slog.Level) *slog.Logger

func SetLogFormat

func SetLogFormat(f LogFormat)

func SetLogLevel

func SetLogLevel(lv LogLevel)

Types

type LogFormat

type LogFormat uint8
const (
	LogFormatJSON LogFormat = iota
	LogFormatTEXT
)

func (LogFormat) MarshalText

func (f LogFormat) MarshalText() ([]byte, error)

func (*LogFormat) UnmarshalText

func (f *LogFormat) UnmarshalText(data []byte) error

type LogLevel

type LogLevel slog.Level

func GetLogLevel

func GetLogLevel() LogLevel

func ParseLogLevel

func ParseLogLevel(s string) (LogLevel, error)

func (LogLevel) Level

func (lv LogLevel) Level() slog.Level

func (LogLevel) MarshalText

func (lv LogLevel) MarshalText() ([]byte, error)

func (LogLevel) String

func (lv LogLevel) String() string

func (*LogLevel) UnmarshalText

func (lv *LogLevel) UnmarshalText(v []byte) error

type Logger

type Logger interface {
	WithGroup(string) Logger
	With(...any) Logger
	LogIfEnabled(ctx context.Context, lv LogLevel, msg string)
}

func StdDiscardLogger

func StdDiscardLogger(skip int, lv LogLevel) Logger

func StdLogger

func StdLogger(w io.Writer, skip int, lv LogLevel) Logger

func ZapDiscardLogger

func ZapDiscardLogger(skip int, lv LogLevel) Logger

func ZapLogger

func ZapLogger(w io.Writer, skip int, lv LogLevel) Logger

type SecurityStringer

type SecurityStringer interface {
	SecurityString() string
}

Jump to

Keyboard shortcuts

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