logger

package
v0.0.0-...-e319382 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 8 Imported by: 28

Documentation

Index

Constants

View Source
const (
	FATAL int = iota
	WARN
	INFO
	DEBUG
	TRACE
)

Logging Levels

Variables

This section is empty.

Functions

func Custom

func Custom(level string, args ...interface{})

Custom logs a message using provided level as log level

func Customf

func Customf(level string, format string, args ...interface{})

Customf logs a message with arguments using provided level as log level

func Debug

func Debug(args ...interface{})

Debug function logs a message using DEBUG as log level if DEBUG environment variable is enabled

func Debugf

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

Debugf function logs a message with arguments using DEBUG as log level if DEBUG environment variable is enabled

func Fatal

func Fatal(args ...interface{})

Fatal function logs a message using FATAL as log level followed by a call to os.Exit(1)

func Fatalf

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

Fatalf function logs a message with arguments using FATAL as log level followed by a call to os.Exit(1)

func Info

func Info(args ...interface{})

Info function logs a message using INFO as log level

func Infof

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

Infof function logs a message with arguments using INFO as log level

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel ...

func Trace

func Trace(args ...interface{})

Trace function logs a message using TRACE as log level

func Tracef

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

Tracef function logs a message with arguments using TRACE as log level

func Warning

func Warning(args ...interface{})

Warning function logs a message using WARNING as log level

func Warningf

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

Warningf function logs a message with arguments using WARNING as log level

Types

type Logger

type Logger struct {
	Timestamp time.Time `json:"timestamp"`
	Level     *string   `json:"level"`
	Src       *Source   `json:"src,omitempty"`
	Message   *string   `json:"message"`
}

Logger stuct contains the log details

type Source

type Source struct {
	Func string `json:"func,omitempty"`
	Line int    `json:"line,omitempty"`
}

Source struct contains the source details

Jump to

Keyboard shortcuts

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