mode

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilLogModeMap = errors.New("log mode map cannot be nil")
)

Functions

This section is empty.

Types

type DefaultLogger

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

DefaultLogger is the default mode logger

func NewDefaultLogger

func NewDefaultLogger(
	logger gologger.Logger,
	flagMode *goflagsmode.Flag,
) (
	*DefaultLogger,
	error,
)

NewDefaultLogger creates a new default mode logger

Parameters:

  • logger: the logger to use
  • flagMode: the mode flag to use

func (DefaultLogger) Critical

func (d DefaultLogger) Critical(header, subheader string, details *[]string)

Critical logs a critical message

Parameters:

  • header: the header of the critical message
  • subheader: the subheader of the critical message
  • details: the details of the critical message

func (DefaultLogger) Debug

func (d DefaultLogger) Debug(header, subheader string, details *[]string)

Debug logs a debug message

func (DefaultLogger) Error

func (d DefaultLogger) Error(header, subheader string, errors *[]error)

Error logs an error message

Parameters:

  • header: the header of the error message
  • subheader: the subheader of the error message
  • errors: the errors of the error message

func (DefaultLogger) Info

func (d DefaultLogger) Info(header, subheader string, details *[]string)

Info logs an info message

Parameters:

  • header: the header of the info message
  • subheader: the subheader of the info message
  • details: the details of the info message

func (DefaultLogger) Log

func (d DefaultLogger) Log(message *gologger.Message)

Log logs a message

Parameters:

  • message: the message to log

func (DefaultLogger) RunIfShouldLog

func (d DefaultLogger) RunIfShouldLog(
	status gologgerstatus.Status,
	fn func(),
)

RunIfShouldLog runs the function if the log should be logged

Parameters:

  • status: the status of the log
  • fn: the function to run if the log should be logged

func (DefaultLogger) ShouldLog

func (d DefaultLogger) ShouldLog(status gologgerstatus.Status) bool

ShouldLog checks if the log should be logged

Parameters:

  • status: the status of the log

Returns:

  • bool: true if the log should be logged, false otherwise

func (DefaultLogger) Warning

func (d DefaultLogger) Warning(header, subheader string, details *[]string)

Warning logs a warning message

Parameters:

  • header: the header of the warning message
  • subheader: the subheader of the warning message
  • details: the details of the warning message

type Logger

type Logger interface {
	ShouldLog(status gologgerstatus.Status) bool
	RunIfShouldLog(status gologgerstatus.Status, fn func())
	gologger.Logger
}

Logger interface for the mode logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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