Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultLogCollectorMaxItems defines default maximum size of LogCollector. DefaultLogCollectorMaxItems = 50 // DefaultLogCollectorItemLifetime is the default time after which LogItem will be removed from LogCollector. DefaultLogCollectorItemLifetime = 15 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogCollector ¶
LogCollector keeps recent log events. It is automatically truncated on each access based on predefined set of conditions.
func NewLogCollector ¶
func NewLogCollector() *LogCollector
NewLogCollector creates new LogCollector.
func (*LogCollector) GetLogs ¶
func (lc *LogCollector) GetLogs() []LogItem
GetLogs returns a copy of messages in log. This is an actual copy, so it will not reflect any future changes in log.
func (*LogCollector) Log ¶
func (lc *LogCollector) Log(msg string, level LogLevel)
Log logs a single provided message in LogCollector.
Click to show internal directories.
Click to hide internal directories.