log

package
v0.0.0-...-6054725 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConsoleColors is a ConsoleColorsType singleton, which has a set of methods that return the color directive to change console color
	ConsoleColors = ConsoleColorsType{}
)

Functions

func Debug

func Debug(a ...interface{})

Debug logs debug-level message using default logger.

func Debugf

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

Debugf logs formatted debug-level message using default logger.

func Error

func Error(err error)

Error logs error-level message using default logger.

func Errorf

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

Errorf logs formatted error-level formatted string message using default logger.

func Fatal

func Fatal(err error)

Fatal logs error-level message using default logger then calls os.Exit(1).

func Fatalf

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

Fatalf logs formatted error-level formatted string message using default logger then calls os.Exit(1).

func Info

func Info(a ...interface{})

Info logs info-level message using default logger.

func Infof

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

Infof logs formatted info-level message using default logger.

func InitDefault

func InitDefault(output io.Writer, config *types.Config)

InitDefault creates default logger for package-level logging access.

func Panic

func Panic(err error)

Panic logs error-level message using default logger then calls panic().

func Panicf

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

Panicf logs formatted error-level formatted string message using default logger then calls panic().

func Warn

func Warn(a ...interface{})

Warn logs warning-level message using default logger.

func Warnf

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

Warnf logs formatted warning-level message using default logger.

Types

type ConsoleColorsType

type ConsoleColorsType struct{}

ConsoleColorsType has a set of methods that return the color directive to change console color

func (ConsoleColorsType) Blue

func (ConsoleColorsType) Blue() string

Blue returns blue directive

func (ConsoleColorsType) Cyan

func (ConsoleColorsType) Cyan() string

Cyan returns cyan directive

func (ConsoleColorsType) Green

func (ConsoleColorsType) Green() string

Green returns green directive

func (ConsoleColorsType) Purple

func (ConsoleColorsType) Purple() string

Purple returns purple directive

func (ConsoleColorsType) Red

func (ConsoleColorsType) Red() string

Red returns red directive

func (ConsoleColorsType) Reset

func (ConsoleColorsType) Reset() string

Reset returns original color directive

func (ConsoleColorsType) White

func (ConsoleColorsType) White() string

White returns white directive

func (ConsoleColorsType) Yellow

func (ConsoleColorsType) Yellow() string

Yellow returns yellow directive

type Logger

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

Logger filters and prints messages to a destination

func New

func New(output io.Writer) *Logger

New returns an instance of Logger

func (*Logger) Debug

func (l *Logger) Debug(a ...interface{})

Debug checks debug level is activated to write the message

func (*Logger) Debugf

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

Debugf checks debug level is activated to write the message

func (*Logger) Error

func (l *Logger) Error(err error)

Error checks error level is activated to write error object

func (*Logger) Errorf

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

Errorf checks error level is activated to write the formatted message

func (*Logger) Info

func (l *Logger) Info(a ...interface{})

Info checks info level is activated to write the message

func (*Logger) Infof

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

Infof checks info level is activated to write the formatted message

func (*Logger) Log

func (l *Logger) Log(a ...interface{})

Log writes message to the specified output

func (*Logger) Logf

func (l *Logger) Logf(format string, a ...interface{})

Logf writes a formatted message to the specified output

func (*Logger) SetDebug

func (l *Logger) SetDebug(value bool)

SetDebug activates/deactivates debug level

func (*Logger) SetError

func (l *Logger) SetError(value bool)

SetError activates/deactivates error level

func (*Logger) SetInfo

func (l *Logger) SetInfo(value bool)

SetInfo activates/deactivates info level

func (*Logger) SetWarn

func (l *Logger) SetWarn(value bool)

SetWarn activates/deactivates warn level

func (*Logger) Warn

func (l *Logger) Warn(a ...interface{})

Warn checks warn level is activated to write the message

func (*Logger) Warnf

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

Warnf checks warn level is activated to write the formatted message

Jump to

Keyboard shortcuts

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