Documentation
¶
Index ¶
- Constants
- Variables
- func SetDefault(l *Log)
- type Log
- func (d *Log) Debug(message string, args ...any)
- func (d *Log) Debugf(message string, args ...any)
- func (d *Log) Default(message string, args ...any)
- func (d *Log) Defaultf(message string, args ...any)
- func (d *Log) Error(message string, args ...any)
- func (d *Log) Errorf(message string, args ...any)
- func (d *Log) Fatal(message string, args ...any)
- func (d *Log) Fatalf(message string, args ...any)
- func (d *Log) Info(message string, args ...any)
- func (d *Log) Infof(message string, args ...any)
- func (d *Log) Prefix() string
- func (d *Log) Println(message string, args ...any)
- func (d *Log) Printlnf(message string, args ...any)
- func (d *Log) Question(message string, args ...any)
- func (d *Log) Questionf(message string, args ...any)
- func (d *Log) Secondary(message string, args ...any)
- func (d *Log) Secondaryf(message string, args ...any)
- func (d *Log) SetPrefix(prefix string)
- func (d *Log) Success(message string, args ...any)
- func (d *Log) Successf(message string, args ...any)
- func (d *Log) Warning(message string, args ...any)
- func (d *Log) Warningf(message string, args ...any)
- type PrefixSimpleHandler
- func (h *PrefixSimpleHandler) Enabled(_ context.Context, _ slog.Level) bool
- func (h *PrefixSimpleHandler) Handle(_ context.Context, r slog.Record) error
- func (h *PrefixSimpleHandler) SetPrefix(prefix string)
- func (h *PrefixSimpleHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *PrefixSimpleHandler) WithGroup(name string) slog.Handler
Constants ¶
View Source
const ( Ldate int = log.Ldate // Print the date in the local time zone Ltime int = log.Ltime // Print the time in the local time zone Lmicroseconds int = log.Lmicroseconds // Print the time with microsecond precision Llongfile int = log.Llongfile // Print full file name and line number Lshortfile int = log.Lshortfile // Print final file name element and line number LUTC int = log.LUTC // Print date and time in UTC Lmsgprefix int = log.Lmsgprefix // Move the prefix from the beginning of the line to before the message LstdFlags int = log.LstdFlags // Standard flags: Ldate | Ltime )
Log flags that control the output format
Variables ¶
View Source
var ( DEBUG bool = false // Global debug flag Output io.Writer = os.Stderr // Default output writer Prefix string = "" // Default prefix for all loggers Flags int = 0 // Default flags for all loggers )
Global configuration variables
Functions ¶
func SetDefault ¶
func SetDefault(l *Log)
Types ¶
type Log ¶
Log represents a logger instance with enhanced functionality
func (*Log) Secondaryf ¶
Secondaryf prints a formatted message with secondary color
type PrefixSimpleHandler ¶
type PrefixSimpleHandler struct {
// contains filtered or unexported fields
}
func NewPrefixSimpleHandler ¶
func NewPrefixSimpleHandler(w io.Writer, prefix string) *PrefixSimpleHandler
func (*PrefixSimpleHandler) SetPrefix ¶
func (h *PrefixSimpleHandler) SetPrefix(prefix string)
Click to show internal directories.
Click to hide internal directories.