logger

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EndLine

func EndLine() string

EndLine returns the a newline escape character

func Now

func Now(layout string) string

Now returns the current local time in the specified layout

Types

type CliLogger

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

CliLogger logs logging records to the specified io.Writer

func GetCliLogger

func GetCliLogger(w io.Writer) *CliLogger

GetCliLogger initializes the logger instance with a NewColorWriter output and returns a singleton

func (*CliLogger) Critical

func (l *CliLogger) Critical(message string)

Critical outputs a critical log message

func (*CliLogger) Criticalf

func (l *CliLogger) Criticalf(message string, vars ...interface{})

Criticalf outputs a formatted critical log message

func (*CliLogger) Debug

func (l *CliLogger) Debug(message string, file string, line int)

Debug outputs a debug log message

func (*CliLogger) Debugf

func (l *CliLogger) Debugf(message string, file string, line int, vars ...interface{})

Debugf outputs a formatted debug log message

func (*CliLogger) Error

func (l *CliLogger) Error(message string)

Error outputs an error log message

func (*CliLogger) Errorf

func (l *CliLogger) Errorf(message string, vars ...interface{})

Errorf outputs a formatted error log message

func (*CliLogger) Fatal

func (l *CliLogger) Fatal(message string)

Fatal outputs a fatal log message and exists

func (*CliLogger) Fatalf

func (l *CliLogger) Fatalf(message string, vars ...interface{})

Fatalf outputs a formatted log message and exists

func (*CliLogger) Hint

func (l *CliLogger) Hint(message string)

Hint outputs a hint log message

func (*CliLogger) Hintf

func (l *CliLogger) Hintf(message string, vars ...interface{})

Hintf outputs a formatted hint log message

func (*CliLogger) Info

func (l *CliLogger) Info(message string)

Info outputs an information log message

func (*CliLogger) Infof

func (l *CliLogger) Infof(message string, vars ...interface{})

Infof outputs a formatted information log message

func (*CliLogger) SetOutput

func (l *CliLogger) SetOutput(w io.Writer)

SetOutput sets the logger output destination

func (*CliLogger) Success

func (l *CliLogger) Success(message string)

Success outputs a success log message

func (*CliLogger) Successf

func (l *CliLogger) Successf(message string, vars ...interface{})

Successf outputs a formatted success log message

func (*CliLogger) Warn

func (l *CliLogger) Warn(message string)

Warn outputs a warning log message

func (*CliLogger) Warnf

func (l *CliLogger) Warnf(message string, vars ...interface{})

Warnf outputs a formatted warning log message

type LogRecord

type LogRecord struct {
	ID       string
	Level    string
	Message  string
	Filename string
	LineNo   int
}

LogRecord represents a log record and contains the timestamp when the record was created, an increasing id, level and the actual formatted log line.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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