gokit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package gokit provides a go-kit/log.Logger that uses a slog.Handler.

This is a PROOF OF CONCEPT. It is not production-ready.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(h slog.Handler, messageKey string) gklog.Logger

New returns go-kit logger that calls h.Handle.

If messageKey is not empty, it is used to extract the message from the list of key-value pairs.

The logger looks for a level (a value of type go-kit/log/level.Value) in the key-value pairs, extracts it, and converts it to a slog.Level.

The logger does nothing with timestamps. It calls the handler with a zero timestamp, which should suppress the default timestamp output. If there is a timestamp in the key-value pairs, it will be output as an ordinary attribute.

Types

This section is empty.

Jump to

Keyboard shortcuts

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