Skip to content

rawnly/logre-client-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logre Go Client

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

Installation

  go get -u github.com/rawnly/logre-client-go

Getting Started

The 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.

Log with Severity

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" })
}

About

Go client for Logre

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages