mediabakery / ratlog-go

Application Logging for Rats, Humans and Machines – a golang implementation of the ratlog spec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐀 ratlog-go

Application Logging for Rats, Humans and Machines

Go Report Card Go Doc Release

golang implementation of the ratlog spec

There are two way you can use ratlog.

var b bytes.Buffer
rlog := ratlog.New(&b)
rlog.Log(Props{message: test.Data.Message, tags: test.Data.Tags, fields: fields})
var b bytes.Buffer
rlog := ratlog.New(&b)
rlog.Message("Hello World").Fields("a": "1", "b": "2").Tag("debug", "error").Log()

You can provide a log instance with an additional tag

var b bytes.Buffer
rlog := ratlog.New(&b)
errorLog := rlog.Tag("error")
errorLog.Message("Hello World").Fields("a": "2", "b": "3").Tag("bla", "baz").Log()
// [error|debug|bla|baz] Hello World | a: 2 | b: 3

About

Application Logging for Rats, Humans and Machines – a golang implementation of the ratlog spec

License:MIT License


Languages

Language:Go 100.0%