logger

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct {
	Name          string
	FormattedName string
}

DefaultLogger is a logger that logs messages

func NewDefaultLogger

func NewDefaultLogger(name string) DefaultLogger

NewDefaultLogger creates a new logger

func (DefaultLogger) BuildMessage

func (d DefaultLogger) BuildMessage(message string) string

BuildMessage creates a string that contains a message that could be either a success or an error

func (DefaultLogger) BuildMessageWithDetails

func (d DefaultLogger) BuildMessageWithDetails(
	message string, details string,
) string

BuildMessageWithDetails creates a string that contains a message with details

func (DefaultLogger) BuildMessageWithDetailsAndStatus added in v0.6.4

func (d DefaultLogger) BuildMessageWithDetailsAndStatus(
	message string, details string, status Status,
) string

BuildMessageWithDetailsAndStatus creates a string that contains a message with details and a status

func (DefaultLogger) LogMessage

func (d DefaultLogger) LogMessage(message string)

LogMessage logs a message

func (DefaultLogger) LogMessageWithDetails

func (d DefaultLogger) LogMessageWithDetails(message string, details string)

LogMessageWithDetails logs a message with details

func (DefaultLogger) LogMessageWithDetailsAndStatus added in v0.6.4

func (d DefaultLogger) LogMessageWithDetailsAndStatus(
	message string, details string, status Status,
)

LogMessageWithDetailsAndStatus logs a message with details and a status

type Logger

type Logger interface {
	BuildMessage(message string) string
	BuildMessageWithDetails(message string, details string) string
	BuildMessageWithDetailsAndStatus(
		message string, details string, status Status) string
	LogMessage(message string)
	LogMessageWithDetails(message string, details string)
	LogMessageWithDetailsAndStatus(
		message string, details string, status Status)
}

Logger is an interface for logging messages

type Status added in v0.6.4

type Status int

Status is the status of the logger

const (
	StatusSuccess Status = iota
	StatusFailed
	StatusError
	StatusWarning
	StatusInfo
	StatusDebug
	StatusTrace
	StatusUnknown
)

func (Status) String added in v0.6.4

func (s Status) String() string

String returns the string representation of the status

Jump to

Keyboard shortcuts

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