Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextLogger ¶
ContextLogger creates a logger with context values. This function uses the global logger configured by Initialize. It adds context values and a component name to the logger.
Parameters:
- ctx: Context that may contain values to be added to the logger
- component: Name of the component, added as a field to all log entries
Returns:
- A zerolog.Logger instance with context and component information
func Initialize ¶
Initialize sets up the zerolog global logger with standard fields. This function should be called once at the start of your application. After calling Initialize, you can use zerolog's log package functions directly (log.Debug(), log.Info(), etc.) or create component-specific loggers with ContextLogger.
Parameters:
- serviceName: Name of the service, added as a field to all log entries
- debug: If true, sets log level to Debug, otherwise Info
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.