ilog

package module
v0.0.0-...-2efd642 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 18

Documentation

Overview

Package ilog contains logging helper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(e error) slog.Attr

Err formats an error into an slog.Attr with Key 'Error'. This only unifies the most common key for errors to use the same constant.

func NewLogHandler

func NewLogHandler(l slog.Level, w io.Writer) *slog.JSONHandler

NewLogHandler creates a new LogHandler. Only log messages with log level l or higher will get written to the writer.

func Setup

func Setup(fs ...string) (io.Closer, error)

Setup changes the log output to the provided files. It keeps logging to /dev/stderr as well.

Types

This section is empty.

Jump to

Keyboard shortcuts

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