Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompletedConfig ¶
type CompletedConfig struct {
*Config
}
CompletedConfig is a completed configuration ready to create a logger.
It wraps Config and provides the NewLogger method to initialize the logger with the configured options.
func (CompletedConfig) NewLogger ¶
func (c CompletedConfig) NewLogger() (*Logger, error)
NewLogger creates and initializes a new Logger instance.
It performs the following initialization steps:
- Creates log directories for all output paths (excluding stdout/stderr).
- Initializes the underlying logging system with Info and Error log options.
Returns an error if directory creation or logger initialization fails.
type Config ¶
type Config struct {
// InfoLogOpts holds configuration for Info-level log output.
InfoLogOpts *logV1.Options
// ErrLogOpts holds configuration for Error-level log output.
ErrLogOpts *logV1.Options
}
Config holds the configuration for creating a logger.
It contains separate options for Info-level and Error-level log outputs, allowing independent configuration of log levels, output paths, and formatting.
func NewConfig ¶
func NewConfig() *Config
NewConfig creates a new Config with default options for both Info and Error logs.
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete transforms Config into a CompletedConfig for logger creation.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides a wrapper for logger initialization and flushing.
It encapsulates the initialization logic (including directory creation and logger setup) and provides a Flush method to ensure all buffered log entries are written before the application exits.