Categorygithub.com/usrpro/clog15
modulepackage
0.0.0-20200404182440-e3e24728322d
Repository: https://github.com/usrpro/clog15.git
Documentation: pkg.go.dev

# README

Build Status codecov Go Report Card GoDoc

Clog15

Package clog15 provides utilities to embed and extract a log15.Logger to a context. This might be helpfull to preserve logger context while being restricted by funtction signatures. For instance in http.HanderFunc, middleware or gRPC interceptors. It allows you to define logging context and attach the configured logger to a context passed down the executions chain.

License

Copyright (c) 2020, Mohlmann Solutions SRL. All rights reserved. Use of this source code is governed by a BSD 3 Clause License that can be found in the LICENSE file.

# Functions

AddArgs to the logger in the returned context.
Crit is a wrapper for GetLogger().Crit().
Debug is a wrapper for GetLogger().Debug().
Error is a wrapper for GetLogger().Error().
GetLogger retrieves a logger from the context.
Info is a wrapper for GetLogger().Info().
NewLogger creates a new logger from the Root logger.
SetLogger embeds the logger into the returned context.
Warn is a wrapper for GetLogger().Warn().

# Constants

CtxLogger is the context Value key which must be used.