Skip to content

Simple usage

Michael Kenney edited this page Aug 18, 2018 · 2 revisions

The simplest way to use bdlm/log is with the exported package logger:

package main

import (
    log "github.com/bdlm/log"
)

func main() {
    log.WithFields(log.Fields{
        "animal": "walrus",
    }).Info("A walrus appears")
}

Available log method families are Debug, Info, Warn (or Warning), Error, Panic (recoverable), and Fatal.