logger

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = logrus.New()

Functions

func InitLog

func InitLog(log_format Log_Format, log_level Log_Level)

InitLog initializes logs

func WithContext

func WithContext(ctx context.Context, log *Logger) context.Context

WithContext adds logger to context `ctx` and returns the resulting context.

Types

type ContextHook

type ContextHook struct {
}

func (ContextHook) Fire

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

func (ContextHook) Levels

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

type ContextLogger

type ContextLogger interface {
	UseLog(l *Logger)
}

ContextLogger interface for components which support logging with context, via setting a logger to an exisiting one, thereby inheriting its context.

type Log_Format

type Log_Format int32
const (
	Log_json Log_Format = 0
	Log_text Log_Format = 1
)

type Log_Level

type Log_Level int32
const (
	Log_panic Log_Level = iota //0
	Log_fatal                  // 1
	Log_error                  // 2
	Log_warn                   // 3
	Log_info                   // 4
	Log_debug                  // 5
	Log_trace                  // 6
)

type Logger

type Logger struct {
	*logrus.Entry
}

Logger is a wrapper for logrus.Entry.

Jump to

Keyboard shortcuts

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