top

Package llog is a generic logging library used by leven labs. The log methods come in different severities: Debug, Info, Warn, Error, and Fatal.

The log methods take in a string describing the error, and a set of key/value pairs giving the specific context around the error. The string is intended to always be the same no matter what, while the key/value pairs give information like which userID the error happened to, or any other relevant dynamic information.

By default logs will be output to Stdout, without a timestamp attached to them, and only showing entries of level Info or above. All of these can be configured.

All public functions in this package are thread-safe and can be called at any time. The public variables in this package are NOT thread-safe and should only be modified before any logging takes place

Examples:

Info("Something important has occured")
Error("Could not open file", llog.KV{"filename": filename, "err": err})

Imports 1 package(s)

  1. github.com/levenlabs/golib/errctx

Test imports 2 package(s)

  1. github.com/stretchr/testify/require
  2. github.com/stretchr/testify/assert