logger

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 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) 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

type Logger

type Logger interface {
	BuildMessage(message string) string
	BuildMessageWithDetails(message string, details string) string
	LogMessage(message string)
	LogMessageWithDetails(message string, details string)
}

Logger is an interface for logging messages

Jump to

Keyboard shortcuts

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