logger

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 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 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.

type ZZZLogger

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

ZZZLogger logs logging records to the specified io.Writer

func GetLogger

func GetLogger(w io.Writer) *ZZZLogger

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

func (*ZZZLogger) Critical

func (l *ZZZLogger) Critical(message string)

Critical outputs a critical log message

func (*ZZZLogger) Criticalf

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

Criticalf outputs a formatted critical log message

func (*ZZZLogger) Debug

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

Debug outputs a debug log message

func (*ZZZLogger) Debugf

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

Debugf outputs a formatted debug log message

func (*ZZZLogger) Error

func (l *ZZZLogger) Error(message string)

Error outputs an error log message

func (*ZZZLogger) Errorf

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

Errorf outputs a formatted error log message

func (*ZZZLogger) Fatal

func (l *ZZZLogger) Fatal(message string)

Fatal outputs a fatal log message and exists

func (*ZZZLogger) Fatalf

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

Fatalf outputs a formatted log message and exists

func (*ZZZLogger) Hint

func (l *ZZZLogger) Hint(message string)

Hint outputs a hint log message

func (*ZZZLogger) Hintf

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

Hintf outputs a formatted hint log message

func (*ZZZLogger) Info

func (l *ZZZLogger) Info(message string)

Info outputs an information log message

func (*ZZZLogger) Infof

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

Infof outputs a formatted information log message

func (*ZZZLogger) SetOutput

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

SetOutput sets the logger output destination

func (*ZZZLogger) Success

func (l *ZZZLogger) Success(message string)

Success outputs a success log message

func (*ZZZLogger) Successf

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

Successf outputs a formatted success log message

func (*ZZZLogger) Warn

func (l *ZZZLogger) Warn(message string)

Warn outputs a warning log message

func (*ZZZLogger) Warnf

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

Warnf outputs a formatted warning log message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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