logger

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = NewLogger()

Default é a instância global do logger

Functions

func Debug

func Debug(format string, args ...interface{})

Funções helper para usar a instância global

func Error

func Error(format string, args ...interface{})

func Fatal

func Fatal(format string, args ...interface{})

func Fatalf

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

func Info

func Info(format string, args ...interface{})

func Printf

func Printf(format string, args ...interface{})

func SetGlobalLevel

func SetGlobalLevel(level LogLevel)

SetGlobalLevel define o nível de log para a instância global

func SetGlobalTimestamp

func SetGlobalTimestamp(timestamp bool)

SetGlobalTimestamp define se o timestamp deve ser incluído na instância global

func SetGlobalVerbose

func SetGlobalVerbose(verbose bool)

SetGlobalVerbose define o modo verbose para a instância global

func Success

func Success(format string, args ...interface{})

func Warning

func Warning(format string, args ...interface{})

Types

type LogLevel

type LogLevel int

LogLevel define os níveis de log disponíveis

const (
	DEBUG LogLevel = iota
	INFO
	SUCCESS
	WARNING
	ERROR
	FATAL
)

type Logger

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

Logger é a estrutura principal do logger

func NewLogger

func NewLogger() *Logger

NewLogger cria uma nova instância do logger

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

Debug loga mensagens de debug (apenas em modo verbose)

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

Error loga mensagens de erro

func (*Logger) Fatal

func (l *Logger) Fatal(format string, args ...interface{})

Fatal loga mensagens fatais e encerra o programa

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

Fatalf loga uma mensagem fatal e encerra o programa

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

Info loga mensagens informativas

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

Printf loga uma mensagem com nível INFO

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

SetLevel define o nível mínimo de log

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput define o writer de saída

func (*Logger) SetTimestamp

func (l *Logger) SetTimestamp(timestamp bool)

SetTimestamp define se o timestamp deve ser incluído

func (*Logger) SetVerbose

func (l *Logger) SetVerbose(verbose bool)

SetVerbose define se o modo verbose está ativo

func (*Logger) Success

func (l *Logger) Success(format string, args ...interface{})

Success loga mensagens de sucesso

func (*Logger) Warning

func (l *Logger) Warning(format string, args ...interface{})

Warning loga mensagens de aviso

Jump to

Keyboard shortcuts

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