Documentation ¶
Index ¶
- Constants
- func GenUUID4() (string, error)
- func GetAWSPublicHostname() (hostname string, err error)
- func ScanUUID(uuids string) ([]byte, error)
- type Fields
- type HekaLogger
- func (self HekaLogger) Critical(mtype, msg string, fields Fields) (err error)
- func (self HekaLogger) Debug(mtype, msg string, fields Fields) (err error)
- func (self HekaLogger) Error(mtype, msg string, fields Fields) (err error)
- func (self HekaLogger) Info(mtype, msg string, fields Fields) (err error)
- func (self HekaLogger) Log(level int32, mtype, payload string, fields Fields) (err error)
- func (self HekaLogger) Warn(mtype, msg string, fields Fields) (err error)
- type HekaStdoutSender
- type JsMap
- type Metrics
- func (self *Metrics) Decrement(metric string)
- func (self *Metrics) Increment(metric string)
- func (self *Metrics) IncrementBy(metric string, count int)
- func (self *Metrics) Prefix(newPrefix string)
- func (self *Metrics) Snapshot() map[string]interface{}
- func (self *Metrics) Timer(metric string, value int64)
- type MzConfig
Constants ¶
const ( CRITICAL = iota ERROR WARNING INFO DEBUG )
Message levels
Variables ¶
This section is empty.
Functions ¶
func GetAWSPublicHostname ¶
Get the public AWS hostname for this machine. * TODO: Make this a generic utility for getting public info from * the aws meta server?
Types ¶
type Fields ¶
The fields to relay. NOTE: object reflection is VERY CPU expensive. I specify strings here to reduce that as much as possible. Please do not change this to something like map[string]interface{} since that can dramatically increase server load.
type HekaLogger ¶
type HekaLogger struct {
// contains filtered or unexported fields
}
func NewHekaLogger ¶
func NewHekaLogger(conf *MzConfig) *HekaLogger
Create a new Heka logging interface.
func (HekaLogger) Critical ¶
func (self HekaLogger) Critical(mtype, msg string, fields Fields) (err error)
record the Highest priority message, and include a printstack to STDERR
func (HekaLogger) Debug ¶
func (self HekaLogger) Debug(mtype, msg string, fields Fields) (err error)
func (HekaLogger) Error ¶
func (self HekaLogger) Error(mtype, msg string, fields Fields) (err error)
func (HekaLogger) Info ¶
func (self HekaLogger) Info(mtype, msg string, fields Fields) (err error)
record the lowest priority message
func (HekaLogger) Log ¶
func (self HekaLogger) Log(level int32, mtype, payload string, fields Fields) (err error)
Logging workhorse function. Chances are you're not going to call this directly, but via one of the helper methods. of Info() .. Critical() level - One of the defined logging CONST values mtype - Message type, Short class identifier for the message payload - Main error message fields - additional optional key/value data associated with the message.
type HekaStdoutSender ¶
type HekaStdoutSender struct{}
func (*HekaStdoutSender) Close ¶
func (h *HekaStdoutSender) Close()
func (*HekaStdoutSender) SendMessage ¶
func (h *HekaStdoutSender) SendMessage(outBytes []byte) (err error)
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(prefix string, logger *HekaLogger, config *MzConfig) (self *Metrics)
func (*Metrics) IncrementBy ¶
type MzConfig ¶
type MzConfig struct {
// contains filtered or unexported fields
}
func ReadMzConfig ¶
Read a ini like configuration file into a map
func (*MzConfig) Get ¶
Get a value from the config map, providing an optional default.
This is a fairly common behavior for me.
func (*MzConfig) SetDefault ¶
Set a value if it's not already defined