log

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 11 Imported by: 3

README

log-slog

Initialize log/slog and Sentry with viper

Usage

See: main.go

Documentation

Index

Constants

View Source
const (
	HandlerText   = "text"
	HandlerJSON   = "json"
	HandlerSentry = "sentry"
)
View Source
const (
	OutputStdOut = "stdout"
	OutputFile   = "file"
)
View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)
View Source
const (
	RFC3339Micro = "2006-01-02T15:04:05.999999Z"
)

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Get

func Get() *slog.Logger

func Info

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

func New

func New(v *viper.Viper) (*slog.Logger, error)

func Set

func Set(v *viper.Viper) error

func Warn

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

func With

func With(args ...any) *slog.Logger

func WithGroup

func WithGroup(name string) *slog.Logger

Types

This section is empty.

Directories

Path Synopsis
examples
basic command

Jump to

Keyboard shortcuts

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