Skip to content

Instantly share code, notes, and snippets.

@phemmer
Created February 4, 2015 15:07
Show Gist options
  • Select an option

  • Save phemmer/d6c09f4004e575606d23 to your computer and use it in GitHub Desktop.

Select an option

Save phemmer/d6c09f4004e575606d23 to your computer and use it in GitHub Desktop.
sawmill
package main
import (
sm "github.com/phemmer/sawmill"
)
type mymap map[string]interface{}
type mystruct struct {
Foo string
Bar string
Map mymap
List []string
}
func main() {
data := mymap{
"pop": "tart",
"mystruct": &mystruct{Foo: "foo!", Bar: "bar?", List: []string{"a","b","c"}},
"bool": false,
"num": 0x24,
}
//for i := 0; i < 100000; i++ {
sm.Event(sm.Error, "baz!", data)
//}
sm2 := sm.NewLogger()
sm2.InitStdStreams()
sm2.InitStdSyslog()
//log := &sm.Logger{}
sm2.Event(sm.Notice, "log", sm.Fields{"foo": "bar"})
mystructp := &mystruct{Foo: "bar"}
sm2.Event(sm.Info, "struct", mystructp)
sm2.Stop()
sm.DefaultLogger().Stop()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment