Documentation
¶
Index ¶
- func FindMaxFileIndex(path string, dotGz string) (int, string)
- func GetFileIndex(path string) int
- func ParseOutputPath(c *Config, outputPath string) string
- func SetFileIndex(path string, index int) string
- func SplitBaseIndexExt(path string) (base, index, ext string)
- type Config
- type FileWriter
- type Flusher
- type LfLog
- type LfStdout
- type Option
- type QueueWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindMaxFileIndex ¶
FindMaxFileIndex finds the maxIndex index of a file like log-2021-05-27_00001.log.
func GetFileIndex ¶
func ParseOutputPath ¶
func SetFileIndex ¶
func SplitBaseIndexExt ¶
Types ¶
type FileWriter ¶
type FileWriter struct { FnTemplate string MaxSize uint64 Append bool DotGz string MaxKeepDays int // contains filtered or unexported fields }
func NewFileWriter ¶
func NewFileWriter(fnTemplate string, maxSize uint64, append bool, maxKeepDays int) *FileWriter
func (*FileWriter) Close ¶
func (w *FileWriter) Close() error
func (*FileWriter) Flush ¶
func (w *FileWriter) Flush() error
func (*FileWriter) NewTimedFilename ¶
func (w *FileWriter) NewTimedFilename(template, dotGz string) string
func (*FileWriter) RotateFilename ¶
func (w *FileWriter) RotateFilename(fn string) string
type Option ¶
type Option func(*Config)
func WithAllowDiscard ¶
func WithAppend ¶
func WithConfig ¶
func WithContext ¶
func WithFlushLatency ¶
func WithKeepDays ¶
func WithMaxSize ¶
func WithOutChanSize ¶
type QueueWriter ¶
type QueueWriter struct {
// contains filtered or unexported fields
}
QueueWriter output parsed http messages
func NewQueueWriter ¶
func NewQueueWriter(outputPath string, options ...Option) *QueueWriter
NewQueueWriter creates a new QueueWriter. outputPath: 1. stdout for the stdout 2. somepath/yyyyMMdd.log for the disk file 2.1. somepath/yyyyMMdd.log:append for the disk file for append mode 2.2. somepath/yyyyMMdd.log:100m for the disk file max 100MB size 2.3. somepath/yyyyMMdd.log:100m:append for the disk file max 100MB size and append mode
func (*QueueWriter) Close ¶
func (p *QueueWriter) Close() error
func (*QueueWriter) Send ¶
func (p *QueueWriter) Send(msg string, countDiscards bool)
Click to show internal directories.
Click to hide internal directories.