logger.go
logger.go - Overview
This file defines a logger for the DiceDB project, utilizing both slog
and zerolog
to manage logging levels and output formatting. It configures the logger based on the application's configuration settings.
Detailed Documentation
getSLogLevel
Purpose: Determines the slog
level based on the configured log level.
Returns: The corresponding slog.Level
based on the configuration. Defaults to slog.LevelInfo
if the configured level is not "debug" or "info".
New
Purpose: Creates and configures a new slog.Logger
instance, integrating zerolog
for console output formatting.
Returns: A pointer to a new slog.Logger
instance.