Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamWithNewlineHandler ¶
StreamWithNewlineHandler writes log records to an io.Writer with the given format and appends a newline (\n).
StreamWithNewlineHandler wraps itself with LazyHandler and SyncHandler to evaluate Lazy objects and perform safe concurrent writes.
Types ¶
type BufferingHandler ¶
type BufferingHandler struct {
// contains filtered or unexported fields
}
func NewBufferingHandler ¶
func (*BufferingHandler) Flush ¶
func (b *BufferingHandler) Flush()
Flush can be called to explicitly send all pending records.
type LogstashFormat ¶
type LogstashFormat struct { SourceHost string Instance string Role string Application string Pretty bool OmitEmpty bool // NoStringConvertSet holds keys for which no string conversion must be applied // Not go-routine safe NoStringConvertSet map[string]bool }
func (LogstashFormat) Format ¶
func (f LogstashFormat) Format(r *log15.Record) (data []byte)
Format implements log15.Format
func (*LogstashFormat) NoStringConvert ¶
func (f *LogstashFormat) NoStringConvert(keys ...string)
NoStringConvert registers keys for which the context value should not be converted to a string.
type RedisConnection ¶
type RedisConnection interface { Send(string, ...interface{}) error Close() error Err() error Flush() error }
RedisConnection is the interface of functions we use from redis.
type RedisHandler ¶
type RedisHandler struct {
// contains filtered or unexported fields
}
RedisHandler is a log15.Handler implementation that sends JSON documents to a Redis queue (key).
func NewRedisHandler ¶
NewRedisHandler return a new connected RedisHandler. endpoints is a list of strings using the format host:port
func (*RedisHandler) Close ¶
func (h *RedisHandler) Close()
Close closes the open connection to redis.