Logre client written in GoLang
This logre package provides a fast way to push your logs into logre.io
Are you a Java developer? Check out the Java driver for Logre.IO
go get -u github.com/rawnly/logre-client-goThe easiest way to log is with the Message or Log method.
package main
import "github.com/rawnly/logre-client-go"
func main() {
type Payload struct {
ID uint `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
// initialize the client with your box_id
logre.Init("<Your box_id>")
// Explicity ignoring the error
_, _ = logre.Message("Hello World!")
// You can also log a JSON
_, _ = logre.Log(Payload{ ID: 1, Name: "Rawnly" })
}Since this library is just a wrapper for an API call, we'll need to handle http-errors.
You can also log with severity via Info, Debug, Warning, Error and Fatal methods
package main
import "github.com/rawnly/go-logre"
func main() {
type Payload struct {
ID uint `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
// initialize the client with your box_id
logre.Init("<Your box_id>")
// Explicity ignoring the error
_, _ = logre.DebugMessage("Hello at Debug level")
// You can also log a JSON
_, _ = logre.Debug(Payload{ ID: 1, Name: "Rawnly" })
}