utils

package
v0.0.0-...-b8497f2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetGlobalLogger

func SetGlobalLogger(logger *Logger)

SetGlobalLogger sets the global logger instance.

Types

type Field

type Field struct {
	Key   string
	Value interface{}
}

Field is a key-value pair used for structured logging.

type Logger

type Logger struct {
	*logrus.Logger
}

Logger is a wrapper around logrus.

func GetGlobalLogger

func GetGlobalLogger() *Logger

GetGlobalLogger returns the global logger instance.

func NewLogger

func NewLogger(level, format string, output io.Writer) *Logger

NewLogger creates a new Logger instance.

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...Field)

Error logs a message at the error level with structured fields.

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...Field)

Info logs a message at the info level with structured fields.

Jump to

Keyboard shortcuts

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