log

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 7 Imported by: 33

Documentation

Index

Constants

View Source
const (
	SuccessColor  = color.FgGreen
	InfoColor     = color.FgHiWhite
	NoticeColor   = color.FgHiCyan
	WarningColor  = color.FgYellow
	ErrorColor    = color.FgRed
	DebugColor    = color.FgMagenta
	TraceColor    = color.FgHiMagenta
	CommandColor  = color.FgBlue
	DisabledColor = color.FgHiBlack
)

Logger Ansi Colors

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdLogger

type CmdLogger struct{}

CmdLogger Command Line Logger implementation

func (*CmdLogger) Command

func (l *CmdLogger) Command(format string, words ...string)

Command log message

func (*CmdLogger) Debug

func (l *CmdLogger) Debug(format string, words ...string)

Debug log message

func (*CmdLogger) Disabled

func (l *CmdLogger) Disabled(format string, words ...string)

Disabled log message

func (*CmdLogger) Error

func (l *CmdLogger) Error(format string, words ...string)

Error log message

func (*CmdLogger) Exception added in v0.0.19

func (l *CmdLogger) Exception(err error, format string, words ...string)

Error log message

func (*CmdLogger) Fatal

func (l *CmdLogger) Fatal(format string, words ...string)

Fatal log message

func (*CmdLogger) FatalError

func (l *CmdLogger) FatalError(e error, format string, words ...string)

FatalError log message

func (*CmdLogger) Info

func (l *CmdLogger) Info(format string, words ...string)

Info log information message

func (*CmdLogger) Log

func (l *CmdLogger) Log(format string, level Level, words ...string)

Log Log information message

func (*CmdLogger) LogError

func (l *CmdLogger) LogError(message error)

LogError log message

func (*CmdLogger) LogHighlight

func (l *CmdLogger) LogHighlight(format string, level Level, highlightColor strcolor.ColorCode, words ...string)

LogHighlight Log information message

func (*CmdLogger) Notice

func (l *CmdLogger) Notice(format string, words ...string)

Notice log message

func (*CmdLogger) Success

func (l *CmdLogger) Success(format string, words ...string)

Success log message

func (*CmdLogger) TaskError

func (l *CmdLogger) TaskError(format string, isComplete bool, words ...string)

TaskError log message

func (*CmdLogger) TaskSuccess

func (l *CmdLogger) TaskSuccess(format string, isComplete bool, words ...string)

TaskSuccess log message

func (*CmdLogger) TaskWarn

func (l *CmdLogger) TaskWarn(format string, words ...string)

TaskWarn log message

func (*CmdLogger) Trace

func (l *CmdLogger) Trace(format string, words ...string)

Trace log message

func (*CmdLogger) UseCorrelationId added in v0.0.19

func (l *CmdLogger) UseCorrelationId(value bool)

func (*CmdLogger) UseTimestamp added in v0.0.10

func (l *CmdLogger) UseTimestamp(value bool)

func (*CmdLogger) Warn

func (l *CmdLogger) Warn(format string, words ...string)

Warn log message

type Level

type Level int

Level Entity

const (
	Error Level = iota
	Warning
	Info
	Debug
	Trace
)

LogLevel Enum Definition

type Log

type Log interface {
	UseTimestamp(value bool)
	UseCorrelationId(value bool)
	Log(format string, level Level, words ...string)
	LogHighlight(format string, level Level, highlightColor strcolor.ColorCode, words ...string)
	Info(format string, words ...string)
	Success(format string, words ...string)
	TaskSuccess(format string, isComplete bool, words ...string)
	Warn(format string, words ...string)
	TaskWarn(format string, words ...string)
	Command(format string, words ...string)
	Disabled(format string, words ...string)
	Notice(format string, words ...string)
	Debug(format string, words ...string)
	Trace(format string, words ...string)
	Error(format string, words ...string)
	Exception(err error, format string, words ...string)
	LogError(message error)
	TaskError(format string, isComplete bool, words ...string)
	Fatal(format string, words ...string)
	FatalError(e error, format string, words ...string)
}

Log Interface

type Logger

type Logger struct {
	Loggers        []Log
	LogLevel       Level
	HighlightColor strcolor.ColorCode
	UseTimestamp   bool
}

Logger Default structure

func Get

func Get() *Logger

Get Creates a new Logger instance

func (*Logger) AddCmdLogger

func (l *Logger) AddCmdLogger()

AddCmdLogger Add a command line logger to the system

func (*Logger) AddCmdLoggerWithTimestamp added in v0.0.10

func (l *Logger) AddCmdLoggerWithTimestamp()

func (*Logger) Command

func (l *Logger) Command(format string, words ...string)

Command log message

func (*Logger) Debug

func (l *Logger) Debug(format string, words ...string)

Debug log message

func (*Logger) Disabled

func (l *Logger) Disabled(format string, words ...string)

Disabled log message

func (*Logger) Error

func (l *Logger) Error(format string, words ...string)

Error log message

func (*Logger) Exception added in v0.0.19

func (l *Logger) Exception(err error, format string, words ...string)

Exception log message

func (*Logger) Fatal

func (l *Logger) Fatal(format string, words ...string)

Fatal log message

func (*Logger) FatalError

func (l *Logger) FatalError(e error, format string, words ...string)

FatalError log message

func (*Logger) Info

func (l *Logger) Info(format string, words ...string)

Info log information message

func (*Logger) Log

func (l *Logger) Log(format string, level Level, words ...string)

Log Log information message

func (*Logger) LogError

func (l *Logger) LogError(message error)

LogError log message

func (*Logger) LogHighlight

func (l *Logger) LogHighlight(format string, level Level, words ...string)

LogHighlight Log information message

func (*Logger) Notice

func (l *Logger) Notice(format string, words ...string)

Notice log message

func (*Logger) Success

func (l *Logger) Success(format string, words ...string)

Success log message

func (*Logger) TaskError

func (l *Logger) TaskError(format string, isComplete bool, words ...string)

TaskError log message

func (*Logger) TaskSuccess

func (l *Logger) TaskSuccess(format string, isComplete bool, words ...string)

TaskSuccess log message

func (*Logger) TaskWarn

func (l *Logger) TaskWarn(format string, words ...string)

TaskWarn log message

func (*Logger) Trace

func (l *Logger) Trace(format string, words ...string)

Trace log message

func (*Logger) Warn

func (l *Logger) Warn(format string, words ...string)

Warn log message

func (*Logger) WithCorrelationId added in v0.0.19

func (l *Logger) WithCorrelationId() *Logger

func (*Logger) WithDebug added in v0.0.19

func (l *Logger) WithDebug() *Logger

func (*Logger) WithTimestamp added in v0.0.19

func (l *Logger) WithTimestamp() *Logger

func (*Logger) WithTrace added in v0.0.19

func (l *Logger) WithTrace() *Logger

func (*Logger) WithWarning added in v0.0.19

func (l *Logger) WithWarning() *Logger

type LoggerOptions added in v0.0.19

type LoggerOptions int64

LogOptions Definition

const (
	WithTimestamp LoggerOptions = iota
	WithCorrelationId
)

Jump to

Keyboard shortcuts

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