logger

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

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

DefaultLogger is the default implementation of Logger

func New

func New() *DefaultLogger

New creates a new DefaultLogger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(message string)

Debug logs debug information (only when debug mode is enabled)

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(message string)

Error logs errors

func (*DefaultLogger) FileCreated

func (l *DefaultLogger) FileCreated(path string)

FileCreated logs a file creation event

func (*DefaultLogger) FileFailed

func (l *DefaultLogger) FileFailed(path string, err error)

FileFailed logs a file creation failure

func (*DefaultLogger) GenerationComplete

func (l *DefaultLogger) GenerationComplete(generatorType string)

GenerationComplete logs the completion of a generation process

func (*DefaultLogger) GenerationStarted

func (l *DefaultLogger) GenerationStarted(generatorType string)

GenerationStarted logs the start of a generation process

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(message string)

Info logs general information

func (*DefaultLogger) IsDebugEnabled

func (l *DefaultLogger) IsDebugEnabled() bool

IsDebugEnabled returns whether debug mode is enabled

func (*DefaultLogger) Println

func (l *DefaultLogger) Println(message string)

Println logs a message without logging level

func (*DefaultLogger) SetDebug

func (l *DefaultLogger) SetDebug(enabled bool)

SetDebug enables or disables debug mode

func (*DefaultLogger) Success

func (l *DefaultLogger) Success(message string)

Success logs successful operations

func (*DefaultLogger) Warning

func (l *DefaultLogger) Warning(message string)

Warning logs warnings

type Logger

type Logger interface {
	// Println logs a message without logging level
	Println(message string)
	// Info logs general information
	Info(message string)
	// Success logs successful operations
	Success(message string)
	// Warning logs warnings
	Warning(message string)
	// Error logs errors
	Error(message string)
	// Debug logs debug information (only when debug mode is enabled)
	Debug(message string)
	// SetDebug enables or disables debug mode
	SetDebug(enabled bool)
	// IsDebugEnabled returns whether debug mode is enabled
	IsDebugEnabled() bool
	// FileCreated logs a file creation event
	FileCreated(path string)
	// FileFailed logs a file creation failure
	FileFailed(path string, err error)
	// GenerationStarted logs the start of a generation process
	GenerationStarted(generatorType string)
	// GenerationComplete logs the completion of a generation process
	GenerationComplete(generatorType string)
}

Logger provides methods for logging different types of messages

var Default Logger = New()

Default is a singleton instance of DefaultLogger

Jump to

Keyboard shortcuts

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