stdlogslog

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 9 Imported by: 0

README

stdlogslog

Documentation

Index

Constants

View Source
const (
	LevelTrace = slog.LevelDebug - 4
	LevelDebug = slog.LevelDebug
	LevelInfo  = slog.LevelInfo
	LevelWarn  = slog.LevelWarn
	LevelError = slog.LevelError
	LevelFatal = slog.LevelError + 4
	LevelPanic = slog.LevelError + 8
)

Variables

View Source
var (
	Logger = slog.New(newHandler(os.Stdout, LevelDebug, false, true))
)

Functions

func Debug

func Debug(msg string, args ...any)

func DebugContext

func DebugContext(ctx context.Context, msg string, args ...any)

func EnableConsole

func EnableConsole(logLevel slog.Level, logSource bool, logColour bool)

func EnableLogFile

func EnableLogFile(logLevel slog.Level, logSource bool, folder, filename string, maxAge, rotateTime time.Duration)

func EnableLogFile2

func EnableLogFile2(logLevel slog.Level, logSource bool, folder, filename string, maxBackups, maxSize, maxAge int)

func Error

func Error(msg string, args ...any)

func ErrorContext

func ErrorContext(ctx context.Context, msg string, args ...any)

func Fatal

func Fatal(msg string, args ...any)

func FatalContext

func FatalContext(ctx context.Context, msg string, args ...any)

func Info

func Info(msg string, args ...any)

func InfoContext

func InfoContext(ctx context.Context, msg string, args ...any)

func Panic

func Panic(msg string, args ...any)

func PanicContext

func PanicContext(ctx context.Context, msg string, args ...any)

func Trace

func Trace(msg string, args ...any)

func TraceContext

func TraceContext(ctx context.Context, msg string, args ...any)

func Warn

func Warn(msg string, args ...any)

func WarnContext

func WarnContext(ctx context.Context, msg string, args ...any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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