Skip to content

Custom Logging

Andrew Waters edited this page Mar 29, 2019 · 1 revision

By default, the gomo.Client has a log func that uses the stdlib log.Println(...)

You can also use your own logging instrumentation by passing in a function to handle logging:

handler := func(client *gomo.Client, msg interface{}) {
    // do something with msg
    // you could also check client.Debug to see if you need to do anything,
    // but you may log regardless if you choose
}
client.CustomLogger(handler)

client.Log("Your message")
Clone this wiki locally