logger

package
v1.2.183 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 7 Imported by: 15

Documentation

Overview

Package logger Logger implementation based on slog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, params ...any)

Debug log level

func EnableCaller added in v1.2.179

func EnableCaller(value bool)

EnableCaller enables/disables logging the caller source file and line number.

func EnableJsonFormat added in v1.1.2

func EnableJsonFormat(value bool)

EnableJsonFormat configure log output as json (true) or text line (false)

func EnableStacktrace added in v1.1.2

func EnableStacktrace(value bool)

EnableStacktrace is not supported by slog and is a no-op.

func Error

func Error(format string, params ...any)

Error log level

func Fatal

func Fatal(format string, params ...any)

Fatal log level, followed by os.Exit(1)

func Info

func Info(format string, params ...any)

Info log level

func Init added in v1.1.2

func Init()

Init initialize logger

func SetLevel added in v1.1.2

func SetLevel(level string)

SetLevel log level DEBUG | INFO | WARN | ERROR

func SetTimeLayout added in v1.1.2

func SetTimeLayout(layout string)

SetTimeLayout define the log entry time layout.

func Warn

func Warn(format string, params ...any)

Warn log level

Types

This section is empty.

Jump to

Keyboard shortcuts

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