loggerx

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package loggerx provides helper functions and extensions responsible for logging. The 'x' in the package name stand for 'extension'. It is added to reduce possible conflicts with other packages named 'logger'.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsHCLog

func AsHCLog(logger logrus.FieldLogger, name string) hclog.Logger

AsHCLog return logger that implements the hclog interface, and wraps it around a Logrus entry.

func ExitOnError

func ExitOnError(err error, context string)

ExitOnError exits an app with a given error.

func New

New returns a new logger based on a given configuration. It logs to stdout by default. It's a helper function to maintain backward compatibility.

func NewNoop

func NewNoop() logrus.FieldLogger

NewNoop returns a logger that discards all logged messages. It's suitable for unit-tests.

func NewStderr added in v1.10.0

func NewStderr(cfg config.Logger) logrus.FieldLogger

NewStderr returns a new logger based on a given configuration. It logs to stderr.

func NewStdout added in v1.10.0

func NewStdout(cfg config.Logger) logrus.FieldLogger

NewStdout returns a new logger based on a given configuration. It logs to stdout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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