gokit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: BSD-3-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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