Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogrusLevelToProto ¶
LogrusLevelToProto translates a logrus level to a our protobuf log levels.
Types ¶
type Config ¶
Config is the configuration of logger.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration of logger.
type Context ¶
Context maintains context on logging fields to aid stitching together a history.
func MergeContexts ¶
MergeContexts returns a new merged Context object from the inputs, preferring later inputs.
type EntriesBatch ¶
type EntriesBatch []*Entry
EntriesBatch is a batch of logger.Entry.
func (EntriesBatch) ForEach ¶
func (eb EntriesBatch) ForEach(f func(interface{}) error) error
ForEach implements logs.Batch.
type Entry ¶
type Entry struct { ID int `json:"id"` Message string `json:"message"` Time time.Time `json:"time"` Level logrus.Level `json:"level"` }
Entry captures the interesting attributes of logrus.Entry.
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer is an in-memory buffer based logger.
func NewLogBuffer ¶
NewLogBuffer creates a new LogBuffer.
func (*LogBuffer) Entries ¶
Entries retrieves a snapshot of the newest logged entries.
- startID: Beginning of the range of IDs to include (inclusive).
- endID: End of the range of IDs to include (exclusive).
- limit: Maximum number of entries to return.
Special cases:
- startID == -1: Don't limit the minimum ID.
- endID == -1: Don't limit the maximum ID.
- limit == -1: Don't limit the number of entries.
Click to show internal directories.
Click to hide internal directories.