funcr

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package funcr implements formatting of structured log messages and optionally captures the call site and timestamp.

The simplest way to use it is via its implementation of a github.com/go-logr/logr.LogSink with output through an arbitrary "write" function. See New and NewJSON for details.

Custom LogSinks

For users who need more control, a funcr.Formatter can be embedded inside your own custom LogSink implementation. This is useful when the LogSink needs to implement additional methods, for example.

Formatting

This will respect logr.Marshaler, fmt.Stringer, and error interfaces for values which are being logged. When rendering a struct, funcr will use Go's standard JSON tags (all except "string").

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions