Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsoleDestination ¶
type ConsoleDestination struct{}
ConsoleDestination writes logs to the console
func (*ConsoleDestination) Close ¶
func (c *ConsoleDestination) Close() error
Close closes the console destination (no-op for console)
type Field ¶
type Field struct { Key string Value interface{} }
Field represents a key-value pair for structured logging
type FileDestination ¶
type FileDestination struct {
// contains filtered or unexported fields
}
FileDestination writes logs to a file
func NewFileDestination ¶
func NewFileDestination(filePath string) (*FileDestination, error)
NewFileDestination initializes a new file destination for logs
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(config LoggerConfig) (*Logger, error)
func NewSilentLogger ¶
NewSilentLogger creates a logger that silences all log output
type LoggerConfig ¶
type LoggerConfig struct { Level Level Destination io.WriteCloser ServiceName string }
type RemoteDestination ¶
type RemoteDestination struct {
// contains filtered or unexported fields
}
RemoteDestination simulates sending logs to a remote aggregator (e.g., Prometheus or Grafana)
func NewRemoteDestination ¶
func NewRemoteDestination(url string) *RemoteDestination
func (*RemoteDestination) Close ¶
func (r *RemoteDestination) Close() error
Close closes the remote destination (no-op for this example)
Click to show internal directories.
Click to hide internal directories.