logs

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields map[string]interface{}

Fields type, used to pass to `WithFields`.

type XLogger added in v1.1.0

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

func New added in v1.1.0

func New() XLogger

l is the internal logger

func (*XLogger) Debug added in v1.1.0

func (l *XLogger) Debug(args ...interface{})

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

func (*XLogger) Error added in v1.1.0

func (l *XLogger) Error(args ...interface{})

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

func (*XLogger) Fatal added in v1.1.0

func (l *XLogger) 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 (*XLogger) Info added in v1.1.0

func (l *XLogger) Info(args ...interface{})

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

func (*XLogger) Panic added in v1.1.0

func (l *XLogger) Panic(args ...interface{})

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

func (*XLogger) Printf added in v1.1.0

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

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

func (*XLogger) Println added in v1.1.0

func (l *XLogger) Println(args ...interface{})

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

func (*XLogger) SetPath added in v1.1.0

func (l *XLogger) SetPath(path string) *XLogger

SetPath sets the path for the log file

func (*XLogger) Start added in v1.1.0

func (l *XLogger) Start() *XLogger

Start starts the logging

func (*XLogger) ToConsole added in v1.1.0

func (l *XLogger) ToConsole()

ToConsole sets the logging to console

func (*XLogger) ToFile added in v1.1.0

func (l *XLogger) ToFile(name string)

ToFile sets the logging to file

func (*XLogger) ToFileAndConsole added in v1.1.0

func (l *XLogger) ToFileAndConsole(name string)

ToFileAndConsole sets the logging to file and console

func (*XLogger) Trace added in v1.1.0

func (l *XLogger) Trace(args ...interface{})

Trace logs a message at level Trace on the standard shared.logger.

func (*XLogger) Warn added in v1.1.0

func (l *XLogger) Warn(args ...interface{})

Warn logs a message at level Warn on the standard shared.logger. Deprecated: Use Warn instead

func (*XLogger) Warning added in v1.1.0

func (l *XLogger) Warning(args ...interface{})

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

func (*XLogger) WithField added in v1.1.0

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

WithField creates an entry from the standard logger and adds a field to it. If you want multiple fields, use `WithFields`.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

func (*XLogger) WithFields added in v1.1.0

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

WithFields creates an entry from the standard logger and adds multiple fields to it. This is simply a helper for `WithField`, invoking it once for each field.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

Jump to

Keyboard shortcuts

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