Documentation
¶
Overview ¶
Package logkit provides a configurable *zap.Logger for uber/fx applications.
The module allows configuration for different environments (e.g., "production" for structured JSON logs, "development" for human-readable console logs) and log levels. It also automatically logs service metadata on startup and ensures log buffers are flushed on shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Module ¶
Module provides a configured *zap.Logger and *zap.SugaredLogger to the Fx application container.
Types ¶
type Config ¶
type Config struct {
// Encoding sets the logger's output format. Use "production|json" for JSON
// or "development" for a human-readable console format.
Encoding string `yaml:"encoding" validate:"required,oneof=production prod json development dev console"`
// Level is the minimum log level to record, e.g., "debug", "info", "warn".
Level string `yaml:"level" validate:"required,oneof=debug info warn error dpanic panic fatal"`
}
Config defines the configuration for the logger.
Click to show internal directories.
Click to hide internal directories.