logger

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 9 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close ends logger gracefully

func Debug

func Debug(format string, a ...interface{})

Debug logs debug message

func Error

func Error(format string, a ...interface{})

Error logs error message

func EscapeString

func EscapeString(content string) string

EscapeString escapes value from raw string to be JSON compatible

func Fatal

func Fatal(err error)

Fatal logs error message and exit with status code 1

func Global

func Global(l Logger)

Global sets global logger

func Info

func Info(format string, a ...interface{})

Info logs info message

func Trace

func Trace(format string, a ...interface{})

Trace logs tracing message

func Warn

func Warn(format string, a ...interface{})

Warn logs warning message

Types

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config

Flags adds flags for configuring package

type Logger

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

Logger defines a logger instance

func New

func New(config Config) Logger

New creates a Logger

func (Logger) Close

func (l Logger) Close()

Close ends logger gracefully

func (Logger) Debug

func (l Logger) Debug(format string, a ...interface{})

Debug logs debug message

func (Logger) Error

func (l Logger) Error(format string, a ...interface{})

Error logs error message

func (Logger) Fatal

func (l Logger) Fatal(err error)

Fatal logs error message and exit with status code 1

func (Logger) Info

func (l Logger) Info(format string, a ...interface{})

Info logs info message

func (Logger) Start

func (l Logger) Start()

Start starts logger's writer

func (Logger) Trace

func (l Logger) Trace(format string, a ...interface{})

Trace logs tracing message

func (Logger) Warn

func (l Logger) Warn(format string, a ...interface{})

Warn logs warning message

Jump to

Keyboard shortcuts

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