Documentation
¶
Overview ¶
Package logz provides a global logging utility with configurable settings.
Index ¶
- Variables
- func Alert(msg ...any)
- func Alertf(format string, args ...any)
- func Answer(msg ...any)
- func Answerf(format string, args ...any)
- func Bug(msg ...any)
- func Bugf(format string, args ...any)
- func Critical(msg ...any)
- func Criticalf(format string, args ...any)
- func Debug(msg ...any)
- func Debugf(format string, args ...any)
- func Error(msg ...any) error
- func Errorf(format string, args ...any) error
- func Fatal(msg ...any)
- func Fatalf(format string, args ...any)
- func Fprintf(format string, args ...any)
- func Info(msg ...any)
- func Infof(format string, args ...any)
- func Log(level string, msg ...any) error
- func LogAny(level string, msg any) error
- func NewLogzEntry(level Level) kbx.LogzEntry
- func Notice(msg ...any)
- func Noticef(format string, args ...any)
- func Panic(msg ...any)
- func Panicf(format string, args ...any)
- func ParseWriter(output string) io.Writer
- func Printf(format string, args ...any)
- func Println(msg ...any)
- func Salertf(format string, args ...any) string
- func Sanswerf(format string, args ...any) string
- func Sbugf(format string, args ...any) string
- func Sdebugf(format string, args ...any) string
- func Serrorf(format string, args ...any) error
- func SetDebugMode(debug bool)
- func SetGlobalLogger(logger *LogzLogger)
- func SetGlobalLoggerZ(logger *LogzLoggerZ)
- func SetLogzConfig(opts *LogzConfig)
- func Sinfof(format string, args ...any) string
- func Snoticef(format string, args ...any) string
- func Sprintf(format string, args ...any) string
- func Sprintln(msg ...any) string
- func Ssuccessf(format string, args ...any) string
- func Success(msg ...any)
- func Successf(format string, args ...any)
- func Swarnf(format string, args ...any) string
- func Trace(msg ...any)
- func Tracef(format string, args ...any)
- func Warn(msg ...any)
- func Warnf(format string, args ...any)
- type Entry
- type EntryImpl
- type Level
- type LoggerZ
- type LogzAdvancedOptions
- type LogzBufferingOptions
- type LogzConfig
- type LogzEntry
- type LogzFormatOptions
- type LogzFormatter
- type LogzGeneralOptions
- type LogzHooks
- type LogzIOWriter
- type LogzJSONFormatter
- type LogzLogger
- type LogzLoggerZ
- type LogzMultiWriter
- type LogzOptions
- type LogzOutputOptions
- type LogzPrettyFormatter
- type LogzRotatingOptions
- type LogzTextFormatter
- type LogzWriter
- type Writer
Constants ¶
This section is empty.
Variables ¶
var InitArgs *kbx.InitArgs
Functions ¶
func Fatal ¶
func Fatal(msg ...any)
Fatal logs a fatal message and exits the program with exit code 1.
func Log ¶ added in v1.5.7
Log is the simplest global logging function. Accepts a level as string and variadic messages.
func NewLogzEntry ¶ added in v1.6.3
NewLogzEntry creates a new log entry with the specified level.
func ParseWriter ¶ added in v1.6.3
func SetDebugMode ¶ added in v1.5.7
func SetDebugMode(debug bool)
SetDebugMode enables or disables debug mode for the global logger.
func SetGlobalLogger ¶ added in v1.6.0
func SetGlobalLogger(logger *LogzLogger)
SetGlobalLogger allows setting a custom global logger instance.
func SetGlobalLoggerZ ¶ added in v1.6.0
func SetGlobalLoggerZ(logger *LogzLoggerZ)
SetGlobalLoggerZ allows setting a custom global LoggerZ instance.
func SetLogzConfig ¶ added in v1.6.3
func SetLogzConfig(opts *LogzConfig)
Types ¶
type Entry ¶ added in v1.5.6
func NewEntryStrict ¶ added in v1.6.3
NewEntryStrict creates a new log entry with the specified level. (returns error on failure)
type Level ¶ added in v1.6.0
func ParseLevel ¶ added in v1.6.3
type LoggerZ ¶ added in v1.5.7
type LoggerZ = LogzLoggerZ
type LogzAdvancedOptions ¶ added in v1.6.0
type LogzAdvancedOptions = C.LogzAdvancedOptions
type LogzBufferingOptions ¶ added in v1.6.0
type LogzBufferingOptions = kbx.LogzBufferingOptions
type LogzConfig ¶ added in v1.6.0
type LogzConfig = C.LoggerConfig
type LogzFormatOptions ¶ added in v1.6.0
type LogzFormatOptions = kbx.LogzFormatOptions
type LogzFormatter ¶ added in v1.6.0
func NewLogzFormatter ¶ added in v1.6.0
func NewLogzFormatter(args *LogzFormatOptions, format string) LogzFormatter
type LogzGeneralOptions ¶ added in v1.6.0
type LogzGeneralOptions = kbx.LogzGeneralOptions
type LogzHooks ¶ added in v1.6.3
type LogzHooks[T any] = interfaces.LHook[T]
type LogzIOWriter ¶ added in v1.6.3
type LogzJSONFormatter ¶ added in v1.6.0
type LogzJSONFormatter = formatter.JSONFormatter
type LogzLogger ¶ added in v1.6.0
var Logger *LogzLogger
func GetLogger ¶
func GetLogger(prefix string) *LogzLogger
GetLogger returns the global logger instance, initializing it if necessary.
func NewGlobalLogger ¶ added in v1.6.0
func NewGlobalLogger(prefix string) *LogzLogger
NewGlobalLogger creates a new global logger with the specified prefix.
type LogzLoggerZ ¶ added in v1.6.0
var LoggerLogz *LogzLoggerZ
func GetLoggerZ ¶ added in v1.6.0
func GetLoggerZ(prefix string) *LogzLoggerZ
GetLoggerZ returns the global LoggerZ instance, initializing it if necessary.
func NewLoggerZ ¶ added in v1.5.7
func NewLoggerZ(prefix string, opts *LogzOptions, withDefaults bool) *LogzLoggerZ
NewLoggerZ creates a new LoggerZ with the given prefix, options, and default settings.
type LogzMultiWriter ¶ added in v1.6.3
type LogzMultiWriter = writer.MultiWriter
type LogzOptions ¶ added in v1.6.0
type LogzOptions = C.LoggerOptionsImpl
func NewLogzOptions ¶ added in v1.6.8
func NewLogzOptions(withDefaults bool) *LogzOptions
type LogzOutputOptions ¶ added in v1.6.0
type LogzOutputOptions = kbx.LogzOutputOptions
type LogzPrettyFormatter ¶ added in v1.6.0
type LogzPrettyFormatter = formatter.PrettyFormatter
type LogzRotatingOptions ¶ added in v1.6.0
type LogzRotatingOptions = kbx.LogzRotatingOptions
type LogzTextFormatter ¶ added in v1.6.0
type LogzTextFormatter = formatter.TextFormatter
type LogzWriter ¶ added in v1.6.3
type LogzWriter = writer.LogzWriter
func NewLogzIOWriter ¶ added in v1.6.3
func NewLogzIOWriter(w io.Writer) LogzWriter
func NewLogzMultiWriter ¶ added in v1.6.3
func NewLogzMultiWriter(outputs ...writer.Writer) LogzWriter
func NewLogzWriter ¶ added in v1.6.3
func NewLogzWriter(output string, w io.Writer) LogzWriter
Directories
¶
| Path | Synopsis |
|---|---|
|
cli
Package cli implements the command-line interface for Logz.
|
Package cli implements the command-line interface for Logz. |
|
examples
|
|
|
debug_mode
command
|
|
|
simple
command
|
|
|
Package interfaces defines the Entry interface for log entries.
|
Package interfaces defines the Entry interface for log entries. |
|
internal
|
|
|
core
Package core provides the fundamental logging abstractions and implementations.
|
Package core provides the fundamental logging abstractions and implementations. |
|
formatter
Package formatter é um formatador de log que produz saídas legíveis por humanos.
|
Package formatter é um formatador de log que produz saídas legíveis por humanos. |
|
manager
Package manager implements the processing manager for log entries.
|
Package manager implements the processing manager for log entries. |
|
manager/control
Package control provides atomic flag registries and helpers for job state and security flags.
|
Package control provides atomic flag registries and helpers for job state and security flags. |
|
module
Package module provides internal types and functions for the GoBE application.
|
Package module provides internal types and functions for the GoBE application. |
|
module/control
Package control provides abstractions for managing job states and security flags.
|
Package control provides abstractions for managing job states and security flags. |
|
module/info
Package info provides functionality to read and parse the application manifest.
|
Package info provides functionality to read and parse the application manifest. |
|
module/kbx
Package kbx has default configuration values
|
Package kbx has default configuration values |
|
module/version
Package version provides functionality to manage and check the version of the Kubex Horizon CLI tool.
|
Package version provides functionality to manage and check the version of the Kubex Horizon CLI tool. |
|
writer
Package writer implementa Writers para diferentes destinos.
|
Package writer implementa Writers para diferentes destinos. |
