Skip to content

meinside/loggly-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

loggly-go

A Go library for Loggly.

How to get it

$ go get github.com/meinside/loggly-go

How to use it

// sample.go
package main

import (
	"time"

	"github.com/meinside/loggly-go"
)

func main() {
	logger := loggly.New("XXXXXX-0000-YYYY-ZZZZ-0000000000000")

	time.Sleep(1 * time.Second)	// wait for the logger getting ready

	// can log any type of variable
	logger.Log("Hello loggly.")	// a string,
	for i := 0; i < 42; i++ {
		logger.Log(i)	// a number,
	}
	logger.Log(struct {
		Severity string `json:"severity"`
		Message  string `json:"message"`
	}{
		Severity: "WARN",
		Message:  "This is a warning.",
	})	// or even a struct

	// XXX - wait until all logs are transfered
	time.Sleep(40 * time.Second)
}

License

MIT

About

A Go library for Loggly

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages