logging

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package logging manages setup of common logging interfaces and settings.

Index

Constants

This section is empty.

Variables

View Source
var Debug bool

Debug is a flag that indicates whether debug logging is enabled.

Functions

func SetupLogging

func SetupLogging()

SetupLogging sets up the logging for the application.

Types

type LogrusFileHook

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

LogrusFileHook is a hook to handle writing to a file.

func NewLogrusFileHook

func NewLogrusFileHook(file string, flag int, chmod os.FileMode) (*LogrusFileHook, error)

NewLogrusFileHook creates a new hook to write to a file.

func (*LogrusFileHook) Fire

func (hook *LogrusFileHook) Fire(entry *logrus.Entry) error

Fire is called when a log event is fired.

func (*LogrusFileHook) Levels

func (hook *LogrusFileHook) Levels() []logrus.Level

Levels returns the levels that this hook should be enabled for.

type StandardHook

type StandardHook struct {
	Writer    io.Writer
	LogLevels []logrus.Level
	Formatter *logrus.TextFormatter
}

StandardHook is a hook to handle writing to a file.

func (*StandardHook) Fire

func (hook *StandardHook) Fire(entry *logrus.Entry) error

Fire is called when a log event is fired.

func (*StandardHook) Levels

func (hook *StandardHook) Levels() []logrus.Level

Levels returns the levels that this hook should be enabled for.

Jump to

Keyboard shortcuts

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