logging

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 4 Imported by: 29

Documentation

Overview

Package logging contains helper functions for setting up a CLI wide logger that can be used to log output at various levels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(name string) *logrus.Logger

Create a new logger with the given name

func GetProjectLogger added in v0.13.4

func GetProjectLogger() *logrus.Entry

func SetGlobalLogLevel

func SetGlobalLogLevel(level logrus.Level)

Set the log level. Note: this ONLY affects loggers created using the GetLogger function AFTER this function has been called. Therefore, you need to call this as early in the life of your CLI app as possible!

Types

type TextFormatterWithBinName added in v0.8.0

type TextFormatterWithBinName struct {
	Name          string
	TextFormatter logrus.TextFormatter
}

TextFormatterWithBinName is a logrus formatter that prefixes the binary name to the log output.

func (*TextFormatterWithBinName) Format added in v0.8.0

func (formatter *TextFormatterWithBinName) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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