示例#1
0
文件: example.go 项目: steenzout/gol
func main() {
	log.Send(&gol.LogMessage{"hello": "world!"})
	log.Send(gol.NewError("error", "info"))
	log.Send(gol.NewDebug("debug", "info"))

	errorLog.Send(&gol.LogMessage{"hello": "world!"})
	errorLog.Send(gol.NewEmergency("emergency", "errorLog"))
	errorLog.Send(gol.NewError("error", "errorLog"))
	errorLog.Send(gol.NewWarning("error", "errorLog"))
	errorLog.Send(gol.NewInfo("info", "errorLog"))
	errorLog.Send(gol.NewDebug("debug", "errorLog"))
}
示例#2
0
文件: example.go 项目: steenzout/gol
func main() {
	// this will be written to stderr
	logger.Send(gol.NewEmergency("message", "system is down"))
	logger.Send(gol.NewAlert("message", "failed to write to disk"))
	logger.Send(gol.NewCritical("message", "high server load"))
	logger.Send(gol.NewError("message", "invalid number format"))

	// this will not be written anywhere
	logger.Send(gol.NewWarning("message", "performance close to 1s threshold"))
	logger.Send(gol.NewNotice("message", "failed to communicate with monitoring service"))
	logger.Send(gol.NewInfo("message", "requested processed in 250ms"))
	logger.Send(gol.NewDebug("debug", "var x = 10"))
}