Documentation ¶
Index ¶
Constants ¶
View Source
const ( //Message Flags StreamFlag Flag = 1 << iota //EOP success ExitSuccessFlag //EOP error ExitErrorFlag //LevelStdout stdout message LevelStdout uint16 = 1 // stdout //LevelStderr stderr message LevelStderr uint16 = 2 // stderr //LevelPublic public message LevelPublic uint16 = 3 // message for endusers / public message //LevelOperator operator message LevelOperator uint16 = 4 // message for operator / internal message //LevelUnknown unknown message LevelUnknown uint16 = 5 // log msg (unstructured = level5, cat=unknown) //LevelStructured structured message LevelStructured uint16 = 6 // log msg structured //LevelWarning warning message LevelWarning uint16 = 7 // warning message //LevelOpsError ops error message LevelOpsError uint16 = 8 // ops error //LevelCritical critical message LevelCritical uint16 = 9 // critical error //LevelStatsd statsd message LevelStatsd uint16 = 10 // statsd message(s) AVG //LevelDebug debug message LevelDebug uint16 = 11 // debug message //LevelResultJSON json result message LevelResultJSON uint16 = 20 // result message, json //LevelResultYAML yaml result message LevelResultYAML uint16 = 21 // result message, yaml //LevelResultTOML toml result message LevelResultTOML uint16 = 22 // result message, toml //LevelResultHRD hrd result message LevelResultHRD uint16 = 23 // result message, hrd //LevelResultJob job result message LevelResultJob uint16 = 30 // job, json (full result of a job) )
Variables ¶
View Source
var ( ResultMessageLevels = []uint16{LevelResultJSON, LevelResultYAML, LevelResultTOML, LevelResultHRD, LevelResultJob} )
Functions ¶
func Consume ¶ added in v1.2.0
func Consume(wg *sync.WaitGroup, source io.ReadCloser, level uint16, handler MessageHandler)
Consume consumes a stream to the end, and calls the handler with the parsed stream messages
Types ¶
type Message ¶
type Message struct { Message string `json:"message"` Epoch int64 `json:"epoch"` Meta Meta `json:"meta"` }
Message is a message from running process
Click to show internal directories.
Click to hide internal directories.