log

package
v1.0.57 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

дублирует все функции логгера logrus

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHook

func AddHook(hook logrus.Hook)

AddHook adds a hook to the logger hooks.

func Debug

func Debug(args ...interface{})

func DebugFn

func DebugFn(fn logrus.LogFunction)

func Debugf

func Debugf(format string, args ...interface{})

func Debugln

func Debugln(args ...interface{})

func Error

func Error(args ...interface{})

func ErrorFn

func ErrorFn(fn logrus.LogFunction)

func Errorf

func Errorf(format string, args ...interface{})

func Errorln

func Errorln(args ...interface{})

func Exit

func Exit(code int)

func Fatal

func Fatal(args ...interface{})

func FatalFn

func FatalFn(fn logrus.LogFunction)

func Fatalf

func Fatalf(format string, args ...interface{})

func Fatalln

func Fatalln(args ...interface{})

func GetLevel

func GetLevel() logrus.Level

GetLevel returns the logger level.

func GetLog

func GetLog() *logrus.Logger

GetLog - возвращает глобальный логгер приложения и создаёт логгер если ещё не создан

func Info

func Info(args ...interface{})

func InfoFn

func InfoFn(fn logrus.LogFunction)

func Infof

func Infof(format string, args ...interface{})

func Infoln

func Infoln(args ...interface{})

func IsLevelEnabled

func IsLevelEnabled(level logrus.Level) bool

IsLevelEnabled checks if the log level of the logger is greater than the level param

func Log

func Log(level logrus.Level, args ...interface{})

Log will log a message at the level given as parameter. Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit. For this behaviour Logger.Panic or Logger.Fatal should be used instead.

func LogFn

func LogFn(level logrus.Level, fn logrus.LogFunction)

func Logf

func Logf(level logrus.Level, format string, args ...interface{})

func Logln

func Logln(level logrus.Level, args ...interface{})

func Panic

func Panic(args ...interface{})

func PanicFn

func PanicFn(fn logrus.LogFunction)

func Panicf

func Panicf(format string, args ...interface{})

func Panicln

func Panicln(args ...interface{})

func Print

func Print(args ...interface{})

func PrintFn

func PrintFn(fn logrus.LogFunction)

func Printf

func Printf(format string, args ...interface{})

func Println

func Println(args ...interface{})

func ReplaceHooks

func ReplaceHooks(hooks logrus.LevelHooks) logrus.LevelHooks

ReplaceHooks replaces the logger hooks and returns the old ones

func SetBufferPool

func SetBufferPool(pool logrus.BufferPool)

SetBufferPool sets the logger buffer pool.

func SetFormatter

func SetFormatter(formatter logrus.Formatter)

SetFormatter sets the logger formatter.

func SetLevel

func SetLevel(LOG_LEVEL string)

SetLevel - изменяет уровень логирования

func SetNoLock

func SetNoLock()

When file is opened with appending mode, it's safe to write concurrently to a file (within 4k message on Linux). In these cases user can choose to disable the lock.

func SetOutput

func SetOutput(output io.Writer)

SetOutput sets the logger output.

func SetReportCaller

func SetReportCaller(reportCaller bool)

func Trace

func Trace(args ...interface{})

func TraceFn

func TraceFn(fn logrus.LogFunction)

func Tracef

func Tracef(format string, args ...interface{})

func Traceln

func Traceln(args ...interface{})

func Warn

func Warn(args ...interface{})

func WarnFn

func WarnFn(fn logrus.LogFunction)

func Warnf

func Warnf(format string, args ...interface{})

func Warning

func Warning(args ...interface{})

func WarningFn

func WarningFn(fn logrus.LogFunction)

func Warningf

func Warningf(format string, args ...interface{})

func Warningln

func Warningln(args ...interface{})

func Warnln

func Warnln(args ...interface{})

func WithContext

func WithContext(ctx context.Context) *logrus.Entry

Add a context to the log entry.

func WithError

func WithError(err error) *logrus.Entry

Add an error as single field to the log entry. All it does is call `WithError` for the given `error`.

func WithField

func WithField(key string, value interface{}) *logrus.Entry

WithField allocates a new entry and adds a field to it. Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to this new returned entry. If you want multiple fields, use `WithFields`.

func WithFields

func WithFields(fields logrus.Fields) *logrus.Entry

Adds a struct of fields to the log entry. All it does is call `WithField` for each `Field`.

func WithTime

func WithTime(t time.Time) *logrus.Entry

Overrides the time of the log entry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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