Documentation
¶
Index ¶
- Variables
- func Cleanup()
- func CopyMap(original map[string]interface{}) map[string]interface{}
- func DebugOutput(format string, args ...interface{})
- func InterfaceToSlice(value interface{}) ([]interface{}, bool)
- func IsValidLogFormat(format string) bool
- func LogDebug(msg string, fields map[string]interface{})
- func LogError(msg string, fields map[string]interface{})
- func LogInfo(msg string, fields map[string]interface{})
- func LogWarn(msg string, fields map[string]interface{})
- func RemoveFromSlice(s []string, item string) []string
- func SetExecutionID(id string)
- func SetLogFile(path string) error
- func SetLogFormat(loggingCfg config.LoggingConfig) error
- func SetLogLevel(level string)
- func SyncMapToMap(m *sync.Map) map[string]interface{}
- type LogFormat
Constants ¶
This section is empty.
Variables ¶
var ( // ValidLogFormats contains all supported logging formats ValidLogFormats = []LogFormat{LogFormatPlain, LogFormatJSON} )
Functions ¶
func DebugOutput ¶
func DebugOutput(format string, args ...interface{})
func InterfaceToSlice ¶
func InterfaceToSlice(value interface{}) ([]interface{}, bool)
InterfaceToSlice attempts to convert an interface{} to a []interface{}. It handles cases where the underlying type is already []interface{} or a slice of a specific type (e.g., []string, []int).
func IsValidLogFormat ¶
IsValidLogFormat checks if the given format is supported
func RemoveFromSlice ¶
func SetExecutionID ¶
func SetExecutionID(id string)
SetExecutionID sets a execution ID field that will be included in all subsequent log entries This replaces the logger instance with a new one including the field.
func SetLogFormat ¶
func SetLogFormat(loggingCfg config.LoggingConfig) error
SetLogFormat reconfigures the logger based on the logging configuration.
func SyncMapToMap ¶
SyncMapToMap converts a sync.Map to a regular map[string]interface{}. Note: This provides a snapshot. Concurrent modifications to the original sync.Map after this call won't be reflected in the returned map.