logger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TimeStampFormat = "2006-01-02 15:04:05.000"

TimeStampFormat config time format

Variables

This section is empty.

Functions

func AddHook

func AddHook(hook logrus.Hook)

AddHook with third-party integration

func Debug

func Debug(args ...interface{})

Debug logs a message at level Debug on the standard logger.

func Debugf

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

Debugf logs a message at level Debug on the standard logger.

func Debugln

func Debugln(args ...interface{})

Debugln logs a message at level Debug on the standard logger.

func DisableColor

func DisableColor()

DisableColor for logging console

func Error

func Error(args ...interface{})

Error logs a message at level Error on the standard logger.

func Errorf

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

Errorf logs a message at level Error on the standard logger.

func Errorln

func Errorln(args ...interface{})

Errorln logs a message at level Error on the standard logger.

func Fatal

func Fatal(args ...interface{})

Fatal logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func Fatalf

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

Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1. it do defer os.Exit(1) after print log

func Fatalln

func Fatalln(args ...interface{})

Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func GetLogger

func GetLogger() *logrus.Logger

func Info

func Info(args ...interface{})

Info - print information to stdout You can print output info you need.

func ExampleExamples_output() {
    logger.Info("Hello")
    // Output: Hello
}

func Infof

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

Infof logs a message at level Info on the standard logger.

func Infoln

func Infoln(args ...interface{})

Infoln logs a message at level Info on the standard logger.

func Panic

func Panic(args ...interface{})

Panic logs a message at level Panic on the standard logger.

func Panicf

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

Panicf logs a message at level Panic on the standard logger. it do panic() after print log

func Panicln

func Panicln(args ...interface{})

Panicln logs a message at level Panic on the standard logger.

func Print

func Print(args ...interface{})

Print logs a message at level Info on the standard logger.

func Printf

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

Printf logs a message at level Info on the standard logger.

func Println

func Println(args ...interface{})

Println logs a message at level Info on the standard logger.

func SetLevel

func SetLevel(level string)

SetLevel of logging level

func SetOutputToFile

func SetOutputToFile(path, filenamePrefix string, useDateSuffix bool)

SetOutputToFile out to file

func SetOutputToMW

func SetOutputToMW(path, filenamePrefix string, useDateSuffix bool)

SetOutputToMW , Multi Writer out to os.StdOut and File

func SetOutputToStdOut

func SetOutputToStdOut()

SetOutputToStdOut out to os.StdOut

func StandardLogger

func StandardLogger() *logrus.Logger

StandardLogger for gin gonic integration with logger

func Warn

func Warn(args ...interface{})

Warn logs a message at level Warn on the standard logger.

func Warnf

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

Warnf logs a message at level Warn on the standard logger.

func Warning

func Warning(args ...interface{})

Warning logs a message at level Warn on the standard logger.

func Warningf

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

Warningf logs a message at level Warn on the standard logger.

func Warningln

func Warningln(args ...interface{})

Warningln logs a message at level Warn on the standard logger.

func Warnln

func Warnln(args ...interface{})

Warnln logs a message at level Warn on the standard logger.

Types

type Entry

type Entry struct {
	*logrus.Entry
}

Entry map key value for logger.WithFields

func AddFields

func AddFields(e *Entry, f Fields) *Entry

AddFields appends fields to the log entry using custom logger.Fields

func WithError

func WithError(err error) *Entry

WithError log with error

func WithFields

func WithFields(f Fields) *Entry

WithFields log with your specific field

type Fields

type Fields map[string]interface{}

Fields sub coordinate with WithField method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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