log

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 5

README

Common logging infrastructure

CI codecov

This package contains a Telemetry Logger interface compatible implementation that allows configuring logging scopes that can be configured independently.

Take a look at the examples for more information on how to use the structured and unstructured logging implementations.

For information on the Telemetry Logger interface, see: https://github.com/tetratelabs/telemetry

License

This software is licensed under the Apache License 2.0. See LICENSE file for details.

Documentation

Overview

Package log provides an implementation of the telemetry.Logger interface that allows defining named loggers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.2.0

func New() telemetry.Logger

New creates a new structured logger.

func NewFlattened added in v0.2.3

func NewFlattened() telemetry.Logger

NewFlattened creates a new flattened logger for structured data.

func NewUnstructured added in v0.2.0

func NewUnstructured() telemetry.Logger

NewUnstructured creates a new unstructured logger. NOTE: This logger is not to be used for new development as it goes against the contract of the telemetry.Logger interface. It expects Printf style data from calls to Error, Info, and Debug. It has been added for converting legacy code to use this new logging subsystem.

Example: log.Debug("values should be between %d and %d.", 12, 24)

If you want to have a normal style log output but provide proper structured data, please use the flattened logger by instantiating NewFlattened().

Types

This section is empty.

Jump to

Keyboard shortcuts

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