logh

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// InfoEnabled - check if this level is enabled
	InfoEnabled bool

	// DebugEnabled - check if this level is enabled
	DebugEnabled bool

	// WarnEnabled - check if this level is enabled
	WarnEnabled bool

	// ErrorEnabled - check if this level is enabled
	ErrorEnabled bool

	// FatalEnabled - check if this level is enabled
	FatalEnabled bool

	// PanicEnabled - check if this level is enabled
	PanicEnabled bool
)

Functions

func ConfigureGlobalLogger

func ConfigureGlobalLogger(lvl Level, fmt Format)

ConfigureGlobalLogger - configures the logger globally

func Debug added in v1.29.3

func Debug() *zerolog.Event

Debug - returns the debug event logger if any

func Error added in v1.29.3

func Error() *zerolog.Event

Error - returns the error event logger if any

func Fatal added in v1.29.3

func Fatal() *zerolog.Event

Fatal - returns the error event logger if any

func Info added in v1.29.3

func Info() *zerolog.Event

Info - returns the info event logger if any

func Panic added in v1.29.3

func Panic() *zerolog.Event

Panic - returns the error event logger if any

func SendToStdout

func SendToStdout(output string)

SendToStdout - logs a output with no log format

func Warn added in v1.29.3

func Warn() *zerolog.Event

Warn - returns the error event logger if any

Types

type ContextualLogger added in v1.29.3

type ContextualLogger struct {
	// contains filtered or unexported fields
}

ContextualLogger - a struct containing all valid event loggers (each one can be null if not enabled)

func CreateContextualLogger added in v1.29.3

func CreateContextualLogger(keyValues ...string) *ContextualLogger

CreateContextualLogger - creates loggers with context

func (*ContextualLogger) Debug added in v1.29.3

func (el *ContextualLogger) Debug() *zerolog.Event

Debug - returns the event logger using the configured context

func (*ContextualLogger) Error added in v1.29.3

func (el *ContextualLogger) Error() *zerolog.Event

Error - returns the event logger using the configured context

func (*ContextualLogger) Fatal added in v1.29.3

func (el *ContextualLogger) Fatal() *zerolog.Event

Fatal - returns the event logger using the configured context

func (*ContextualLogger) Info added in v1.29.3

func (el *ContextualLogger) Info() *zerolog.Event

Info - returns the event logger using the configured context

func (*ContextualLogger) Panic added in v1.29.3

func (el *ContextualLogger) Panic() *zerolog.Event

Panic - returns the event logger using the configured context

func (*ContextualLogger) Warn added in v1.29.3

func (el *ContextualLogger) Warn() *zerolog.Event

Warn - returns the event logger using the configured context

type Format

type Format string

Format - the logger's output format

const (
	// JSON - json format
	JSON Format = "json"

	// CONSOLE - plain text format
	CONSOLE Format = "console"
)

type Level

type Level string

Level - type

const (
	// INFO - log level
	INFO Level = "info"

	// DEBUG - log level
	DEBUG Level = "debug"

	// WARN - log level
	WARN Level = "warn"

	// ERROR - log level
	ERROR Level = "error"

	// FATAL - log level
	FATAL Level = "fatal"

	// PANIC - log level
	PANIC Level = "panic"

	// NONE - log level
	NONE Level = "none"

	// SILENT - log level
	SILENT Level = "silent"
)

Jump to

Keyboard shortcuts

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