log

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: 0BSD Imports: 7 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug prints out logs on debug level

func Debugf

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

Formatted print for Debug

func Debugln added in v0.1.13

func Debugln(args ...interface{})

Debug prints out logs on debug level with a newline

func Error

func Error(args ...interface{})

Error prints out logs on error level

func Errorf

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

Formatted print for error

func Errorln added in v0.1.13

func Errorln(args ...interface{})

Error prints out logs on error level with a newline

func Fatal

func Fatal(args ...interface{})

Fatal prints out logs on fatal level

func Fatalf

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

Formatted print for fatal

func Fatalln added in v0.1.13

func Fatalln(args ...interface{})

func Flush

func Flush()

func Info

func Info(args ...interface{})

Info prints out logs on info level

func Infof

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

Formatted print for Info

func Infoln added in v0.1.13

func Infoln(args ...interface{})

Info prints out logs on info level with a newline

func Notice

func Notice(args ...interface{})

Info prints out logs on info level

func Noticef

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

Formatted print for Info

func Noticeln added in v0.1.13

func Noticeln(args ...interface{})

Info prints out logs on info level with a newline

func Panic

func Panic(args ...interface{})

Panic prints out logs on panic level

func Panicf

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

Formatted print for panic

func Panicln added in v0.1.13

func Panicln(args ...interface{})

func Print added in v0.1.13

func Print(args ...interface{})

func Printf added in v0.1.13

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

func Println added in v0.1.13

func Println(args ...interface{})

func SetLogLevel

func SetLogLevel(level Level)

func Trace

func Trace(args ...interface{})

Trace prints out logs on trace level

func Tracef

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

Formatted print for Trace

func Traceln added in v0.1.13

func Traceln(args ...interface{})

Trace prints out logs on trace level with newline

func Warn

func Warn(args ...interface{})

Warn prints out logs on warn level

func Warnf

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

Formatted print for Warn

func Warnln added in v0.1.13

func Warnln(args ...interface{})

Newline print for Warn

Types

type Client

type Client struct {
	LogLevel Level `json:"level"`
	// contains filtered or unexported fields
}

func CreateClient

func CreateClient() *Client

func (*Client) Destroy

func (c *Client) Destroy() error

func (*Client) Get

func (c *Client) Get() Entry

func (*Client) GetLogLevel

func (c *Client) GetLogLevel() Level

func (*Client) SetLogLevel

func (c *Client) SetLogLevel(level Level)

SetLogLevel set log level of logger

type Entry

type Entry struct {
	Timestamp time.Time `json:"timestamp"`
	Output    string    `json:"output"`
	File      string    `json:"file"`
	Level     string    `json:"level"`
	// contains filtered or unexported fields
}

type Level

type Level int
const (
	LTrace Level = iota
	LDebug
	LInfo
	LNotice
	LWarn
	LError
	LPanic
	LFatal
)

type LogWriter

type LogWriter chan Entry

type Logger

type Logger struct {
	FileInfoDepth int
}

func Default added in v1.0.1

func Default() *Logger

func (Logger) Debug

func (l Logger) Debug(args ...interface{})

Debug prints out logs on debug level

func (Logger) Debugf

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

Formatted print for Debug

func (Logger) Error

func (l Logger) Error(args ...interface{})

Error prints out logs on error level

func (Logger) Errorf

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

Formatted print for error

func (Logger) Errorln added in v0.1.13

func (l Logger) Errorln(args ...interface{})

Error prints out logs on error level with a new line

func (Logger) Fatal

func (l Logger) Fatal(args ...interface{})

Fatal prints out logs on fatal level

func (Logger) Fatalf

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

Formatted print for fatal

func (Logger) Fatalln added in v0.1.13

func (l Logger) Fatalln(args ...interface{})

Fatal prints fatal level with a new line

func (Logger) Info

func (l Logger) Info(args ...interface{})

Info prints out logs on info level

func (Logger) Infof

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

Formatted print for Info

func (Logger) Infoln added in v0.1.13

func (l Logger) Infoln(args ...interface{})

Info prints out logs on info level with newline

func (Logger) Notice

func (l Logger) Notice(args ...interface{})

Notice prints out logs on notice level

func (Logger) Noticef

func (l Logger) Noticef(format string, args ...interface{})

Formatted print for Notice

func (Logger) Noticeln added in v0.1.13

func (l Logger) Noticeln(args ...interface{})

Notice prints out logs on notice level with newline

func (Logger) Panic

func (l Logger) Panic(args ...interface{})

Panic prints out logs on panic level

func (Logger) Panicf

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

Formatted print for panic

func (Logger) Panicln added in v0.1.13

func (l Logger) Panicln(args ...interface{})

Panic prints out logs on panic level with a newline

func (Logger) Print added in v0.1.13

func (l Logger) Print(args ...interface{})

Handles print to info

func (Logger) Printf added in v0.1.13

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

Handles formatted print to info

func (Logger) Println added in v0.1.13

func (l Logger) Println(args ...interface{})

Handles print to info with new line

func (*Logger) SetInfoDepth added in v0.1.11

func (l *Logger) SetInfoDepth(depth int)

func (Logger) Trace

func (l Logger) Trace(args ...interface{})

Trace prints out logs on trace level

func (Logger) Tracef

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

Formatted print for Trace

func (Logger) Traceln added in v0.1.13

func (l Logger) Traceln(args ...interface{})

Trace prints out logs on trace level with newline

func (Logger) Warn

func (l Logger) Warn(args ...interface{})

Warn prints out logs on warn level

func (Logger) Warnf

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

Formatted print for Warn

func (Logger) Warnln added in v0.1.13

func (l Logger) Warnln(args ...interface{})

Warn prints out logs on warn level with a newline

Jump to

Keyboard shortcuts

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