Popularity
7.8
Growing
Activity
0.0
-
1,175
35
101

Programming language: Go
License: MIT License
Tags: Logging    
Latest version: v1.9.0

log alternatives and similar packages

Based on the "Logging" category.
Alternatively, view log alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of log or a related project?

Add another 'Logging' Package

README

[Structured logging for golang](assets/title.png)

Package log implements a simple structured logging API inspired by Logrus, designed with centralization in mind. Read more on Medium.

Handlers

  • apexlogs – handler for Apex Logs
  • cli – human-friendly CLI output
  • discard – discards all logs
  • es – Elasticsearch handler
  • graylog – Graylog handler
  • json – JSON output handler
  • kinesis – AWS Kinesis handler
  • level – level filter handler
  • logfmt – logfmt plain-text formatter
  • memory – in-memory handler for tests
  • multi – fan-out to multiple handlers
  • papertrail – Papertrail handler
  • text – human-friendly colored output
  • delta – outputs the delta between log calls and spinner

Example

Example using the Apex Logs handler.

package main

import (
    "errors"
    "time"

    "github.com/apex/log"
)

func main() {
    ctx := log.WithFields(log.Fields{
        "file": "something.png",
        "type": "image/png",
        "user": "tobi",
    })

    for range time.Tick(time.Millisecond * 200) {
        ctx.Info("upload")
        ctx.Info("upload complete")
        ctx.Warn("upload retry")
        ctx.WithError(errors.New("unauthorized")).Error("upload failed")
        ctx.Errorf("failed to upload %s", "img.png")
    }
}

Build Status GoDoc


*Note that all licence references and agreements mentioned in the log README section above are relevant to that project's source code only.