logging

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetVerbosity

func SetVerbosity(v []bool)

SetVerbosity defines the verbosity level of the application

func SetupLogging

func SetupLogging()

SetupLogging will configure logging based on input parameters. It will look at `args.General` to check how the logging should be setup.

Types

type ChiLogWriter

type ChiLogWriter struct {
}

func (*ChiLogWriter) Print

func (lw *ChiLogWriter) Print(a ...interface{})

type ContextHook

type ContextHook struct{}

ContextHook will add go source information (file, line, func)

func (ContextHook) Fire

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

Fire is the method that's executed when logging event is logged. This method will go back the call stack and find which method executed the call.

func (ContextHook) Levels

func (hook ContextHook) Levels() []logrus.Level

Levels defines which logging levels fire the hook. In our case, all levels.

type JSONLogEntry

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

JSONLogEntry prepares the Logrus context

func (*JSONLogEntry) Panic

func (j *JSONLogEntry) Panic(v interface{}, stack []byte)

Panic outputs the log entry into the log

func (*JSONLogEntry) Write

func (j *JSONLogEntry) Write(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})

Write outputs the log entry into the log

type JSONLogFormatter

type JSONLogFormatter struct {
	ServerAddress *net.TCPAddr
}

JSONLogFormatter formats the output for Logrus JSON output

func (*JSONLogFormatter) NewLogEntry

func (j *JSONLogFormatter) NewLogEntry(r *http.Request) middleware.LogEntry

NewLogEntry creates a new entry for the Logrus log

Jump to

Keyboard shortcuts

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