logx

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logx builds an slog logger configured the same way in every project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Level

func Level(s string) slog.Level

Level parses a log level. Anything unknown becomes info.

func New

func New(o Options) *slog.Logger

New creates a logger.

Types

type Options

type Options struct {
	Level  string // debug, info, warn, error
	Format string // json, text
	Writer io.Writer
}

Options configures the logger. Empty fields fall back to defaults: info level, json format, stdout.

Jump to

Keyboard shortcuts

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