Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRouter ¶
func ApplyRouter(logger *ObservableLogger) func(chi.Router)
Types ¶
type LogRotateWriter ¶
type LogRotateWriter struct {
// contains filtered or unexported fields
}
implements io.Writer interface
File base logger with log-rotate capabilities. The rotate process must be initiated from an external goroutine.
After rotation the previous logs file are compressed with gzip algorithm.
The rotated log follows this naming: [filename].UTC time.gz
func NewRotableLogger ¶
func NewRotableLogger(filename string) (*LogRotateWriter, error)
func (*LogRotateWriter) Rotate ¶
func (w *LogRotateWriter) Rotate() error
type ObservableLogger ¶
type ObservableLogger struct {
// contains filtered or unexported fields
}
Logger implementation using the observable pattern. Implements io.Writer interface.
The observable is an event source which drops everythigng unless there's a subscriber connected.
The observer implementatios are a http ServerSentEvents handler and a websocket one in handler.go
func NewObservableLogger ¶
func NewObservableLogger() *ObservableLogger
Click to show internal directories.
Click to hide internal directories.