Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewLine string
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI is a concurrent output writer to terminal.
type Compression ¶ added in v1.1.71
type Compression interface {
// Extension returns the file extension for the compressed file (e.g. ".gz").
Extension() string
// OpenWriter wraps w with a compressing writer.
OpenWriter(w io.Writer) (io.WriteCloser, error)
}
Compression is the minimal interface used to compress rotated log files. It is intentionally small (only what gologger needs) so the package does not depend on a full multi-format archive library for what is effectively gzip.
type FileWithRotation ¶ added in v1.1.5
type FileWithRotation struct {
// contains filtered or unexported fields
}
FileWithRotation is a concurrent output writer to a file with rotation.
func NewFileWithRotation ¶ added in v1.1.5
func NewFileWithRotation(options *FileWithRotationOptions) (*FileWithRotation, error)
NewFileWithRotation returns a new file concurrent log writer.
func (*FileWithRotation) Close ¶ added in v1.1.5
func (w *FileWithRotation) Close()
Close and flushes the logger
func (*FileWithRotation) CreateFile ¶ added in v1.1.5
func (w *FileWithRotation) CreateFile(filename string) (*os.File, error)
type FileWithRotationOptions ¶ added in v1.1.5
type FileWithRotationOptions struct {
Location string
Rotate bool
RotationInterval time.Duration
FileName string
Compress bool
MaxSize int
BackupTimeFormat string
ArchiveFormat Compression
// Helpers
RotateEachHour bool
RotateEachDay bool
// contains filtered or unexported fields
}
var DefaultFileWithRotationOptions FileWithRotationOptions
type GzipCompression ¶ added in v1.1.71
type GzipCompression struct{}
GzipCompression compresses rotated logs using the standard library compress/gzip.
func (GzipCompression) Extension ¶ added in v1.1.71
func (GzipCompression) Extension() string
Extension returns the gzip file extension.
func (GzipCompression) OpenWriter ¶ added in v1.1.71
func (GzipCompression) OpenWriter(w io.Writer) (io.WriteCloser, error)
OpenWriter returns a gzip writer wrapping w.
Click to show internal directories.
Click to hide internal directories.