# Functions
FromContext retrieves the logger from the context.
InitLogger initializes the logger with a specified log level and format (JSON or console).
LogDebug logs debug messages if debug mode is enabled.
LogError logs an error message with optional key-value pairs for structured logging.
LogInfo logs informational messages.
Sync flushes any buffered log entries.
WithLogger attaches the logger to the context.