luet/vendor/github.com/apex/log
Itxaka 4adc0dc9b9
Use goreleaser to build and release (#244)
Instead of using gox on one side and an action to release, we can merge
them together with goreleaser which will build for extra targets (arm,
mips if needed in the future) and it also takes care of creating
checksums, a source archive, and a changelog and creating a release with
all the artifacts.

All binaries should respect the old naming convention, so any scripts
out there should still work.

Signed-off-by: Itxaka <igarcia@suse.com>
2021-08-11 08:30:55 +02:00
..
.gitignore Switch to go mod 2019-11-10 18:05:28 +01:00
context.go Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
default.go Switch to go mod 2019-11-10 18:05:28 +01:00
doc.go Switch to go mod 2019-11-10 18:05:28 +01:00
entry.go Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
go.mod Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
go.sum Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
History.md Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
interface.go Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
levels.go Switch to go mod 2019-11-10 18:05:28 +01:00
LICENSE Switch to go mod 2019-11-10 18:05:28 +01:00
logger.go Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
Makefile Switch to go mod 2019-11-10 18:05:28 +01:00
pkg.go Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
Readme.md Use goreleaser to build and release (#244) 2021-08-11 08:30:55 +02:00
stack.go Switch to go mod 2019-11-10 18:05:28 +01:00

Structured logging for golang

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