mirror of
https://github.com/mudler/luet.git
synced 2025-09-08 02:29:38 +00:00
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>
This commit is contained in:
63
vendor/github.com/apex/log/History.md
generated
vendored
63
vendor/github.com/apex/log/History.md
generated
vendored
@@ -1,4 +1,67 @@
|
||||
|
||||
v1.9.0 / 2020-08-18
|
||||
===================
|
||||
|
||||
* add `WithDuration()` method to record a duration as milliseconds
|
||||
* add: ignore nil errors in `WithError()`
|
||||
* change trace duration to milliseconds (arguably a breaking change)
|
||||
|
||||
v1.8.0 / 2020-08-05
|
||||
===================
|
||||
|
||||
* refactor apexlogs handler to not make the AddEvents() call if there are no events to flush
|
||||
|
||||
v1.7.1 / 2020-08-05
|
||||
===================
|
||||
|
||||
* fix potential nil panic in apexlogs handler
|
||||
|
||||
v1.7.0 / 2020-08-03
|
||||
===================
|
||||
|
||||
* add FlushSync() to apexlogs handler
|
||||
|
||||
v1.6.0 / 2020-07-13
|
||||
===================
|
||||
|
||||
* update apex/logs dep to v1.0.0
|
||||
* docs: mention that Flush() is non-blocking now, use Close()
|
||||
|
||||
v1.5.0 / 2020-07-11
|
||||
===================
|
||||
|
||||
* add buffering to Apex Logs handler
|
||||
|
||||
v1.4.0 / 2020-06-16
|
||||
===================
|
||||
|
||||
* add AuthToken to apexlogs handler
|
||||
|
||||
v1.3.0 / 2020-05-26
|
||||
===================
|
||||
|
||||
* change FromContext() to always return a logger
|
||||
|
||||
v1.2.0 / 2020-05-26
|
||||
===================
|
||||
|
||||
* add log.NewContext() and log.FromContext(). Closes #78
|
||||
|
||||
v1.1.4 / 2020-04-22
|
||||
===================
|
||||
|
||||
* add apexlogs HTTPClient support
|
||||
|
||||
v1.1.3 / 2020-04-22
|
||||
===================
|
||||
|
||||
* add events len check before flushing to apexlogs handler
|
||||
|
||||
v1.1.2 / 2020-01-29
|
||||
===================
|
||||
|
||||
* refactor apexlogs handler to use github.com/apex/logs client
|
||||
|
||||
v1.1.1 / 2019-06-24
|
||||
===================
|
||||
|
||||
|
32
vendor/github.com/apex/log/Readme.md
generated
vendored
32
vendor/github.com/apex/log/Readme.md
generated
vendored
@@ -5,6 +5,7 @@ Package log implements a simple structured logging API inspired by Logrus, desig
|
||||
|
||||
## Handlers
|
||||
|
||||
- __apexlogs__ – handler for [Apex Logs](https://apex.sh/logs/)
|
||||
- __cli__ – human-friendly CLI output
|
||||
- __discard__ – discards all logs
|
||||
- __es__ – Elasticsearch handler
|
||||
@@ -19,6 +20,37 @@ Package log implements a simple structured logging API inspired by Logrus, desig
|
||||
- __text__ – human-friendly colored output
|
||||
- __delta__ – outputs the delta between log calls and spinner
|
||||
|
||||
## Example
|
||||
|
||||
Example using the [Apex Logs](https://apex.sh/logs/) handler.
|
||||
|
||||
```go
|
||||
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")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
[](https://semaphoreci.com/tj/log)
|
||||
|
19
vendor/github.com/apex/log/context.go
generated
vendored
Normal file
19
vendor/github.com/apex/log/context.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package log
|
||||
|
||||
import "context"
|
||||
|
||||
// logKey is a private context key.
|
||||
type logKey struct{}
|
||||
|
||||
// NewContext returns a new context with logger.
|
||||
func NewContext(ctx context.Context, v Interface) context.Context {
|
||||
return context.WithValue(ctx, logKey{}, v)
|
||||
}
|
||||
|
||||
// FromContext returns the logger from context, or log.Log.
|
||||
func FromContext(ctx context.Context) Interface {
|
||||
if v, ok := ctx.Value(logKey{}).(Interface); ok {
|
||||
return v
|
||||
}
|
||||
return Log
|
||||
}
|
14
vendor/github.com/apex/log/entry.go
generated
vendored
14
vendor/github.com/apex/log/entry.go
generated
vendored
@@ -47,11 +47,21 @@ func (e *Entry) WithField(key string, value interface{}) *Entry {
|
||||
return e.WithFields(Fields{key: value})
|
||||
}
|
||||
|
||||
// WithDuration returns a new entry with the "duration" field set
|
||||
// to the given duration in milliseconds.
|
||||
func (e *Entry) WithDuration(d time.Duration) *Entry {
|
||||
return e.WithField("duration", d.Milliseconds())
|
||||
}
|
||||
|
||||
// WithError returns a new entry with the "error" set to `err`.
|
||||
//
|
||||
// The given error may implement .Fielder, if it does the method
|
||||
// will add all its `.Fields()` into the returned entry.
|
||||
func (e *Entry) WithError(err error) *Entry {
|
||||
if err == nil {
|
||||
return e
|
||||
}
|
||||
|
||||
ctx := e.WithField("error", err.Error())
|
||||
|
||||
if s, ok := err.(stackTracer); ok {
|
||||
@@ -141,9 +151,9 @@ func (e *Entry) Trace(msg string) *Entry {
|
||||
// an `err` is passed the "error" field is set, and the log level is error.
|
||||
func (e *Entry) Stop(err *error) {
|
||||
if err == nil || *err == nil {
|
||||
e.WithField("duration", time.Since(e.start)).Info(e.Message)
|
||||
e.WithDuration(time.Since(e.start)).Info(e.Message)
|
||||
} else {
|
||||
e.WithField("duration", time.Since(e.start)).WithError(*err).Error(e.Message)
|
||||
e.WithDuration(time.Since(e.start)).WithError(*err).Error(e.Message)
|
||||
}
|
||||
}
|
||||
|
||||
|
11
vendor/github.com/apex/log/go.mod
generated
vendored
11
vendor/github.com/apex/log/go.mod
generated
vendored
@@ -3,23 +3,30 @@ module github.com/apex/log
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/apex/logs v1.0.0
|
||||
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a
|
||||
github.com/aphistic/sweet v0.2.0 // indirect
|
||||
github.com/aws/aws-sdk-go v1.20.6
|
||||
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59
|
||||
github.com/fatih/color v1.7.0
|
||||
github.com/go-logfmt/logfmt v0.4.0
|
||||
github.com/golang/protobuf v1.3.1 // indirect
|
||||
github.com/google/uuid v1.1.1 // indirect
|
||||
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7 // indirect
|
||||
github.com/kr/pretty v0.2.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.2
|
||||
github.com/pkg/errors v0.8.1
|
||||
github.com/rogpeppe/fastuuid v1.1.0
|
||||
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 // indirect
|
||||
github.com/smartystreets/gunit v1.0.0 // indirect
|
||||
github.com/stretchr/testify v1.3.0
|
||||
github.com/tj/assert v0.0.0-20171129193455-018094318fb0
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/tj/assert v0.0.3
|
||||
github.com/tj/go-buffer v1.1.0
|
||||
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2
|
||||
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b
|
||||
github.com/tj/go-spin v1.1.0
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
|
||||
golang.org/x/text v0.3.2 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.2 // indirect
|
||||
)
|
||||
|
27
vendor/github.com/apex/log/go.sum
generated
vendored
27
vendor/github.com/apex/log/go.sum
generated
vendored
@@ -1,3 +1,5 @@
|
||||
github.com/apex/logs v1.0.0 h1:adOwhOTeXzZTnVuEK13wuJNBFutP0sOfutRS8NY+G6A=
|
||||
github.com/apex/logs v1.0.0/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
|
||||
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a h1:2KLQMJ8msqoPHIPDufkxVcoTtcmE5+1sL9950m4R9Pk=
|
||||
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
|
||||
github.com/aphistic/sweet v0.2.0 h1:I4z+fAUqvKfvZV/CHi5dV0QuwbmIvYYFDjG0Ss5QpAs=
|
||||
@@ -8,6 +10,8 @@ github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc
|
||||
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
@@ -16,6 +20,8 @@ github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80n
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
@@ -26,6 +32,11 @@ github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7 h1:K//n/AqR5HjG3q
|
||||
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
|
||||
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
@@ -55,8 +66,14 @@ github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4S
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/tj/assert v0.0.0-20171129193455-018094318fb0 h1:Rw8kxzWo1mr6FSaYXjQELRe88y2KdfynXdnK72rdjtA=
|
||||
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
|
||||
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
|
||||
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
|
||||
github.com/tj/go-buffer v1.1.0 h1:Lo2OsPHlIxXF24zApe15AbK3bJLAOvkkxEA6Ux4c47M=
|
||||
github.com/tj/go-buffer v1.1.0/go.mod h1:iyiJpfFcR2B9sXu7KvjbT9fpM4mOelRSDTbntVj52Uc=
|
||||
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2 h1:eGaGNxrtoZf/mBURsnNQKDR7u50Klgcf2eFDQEnc8Bc=
|
||||
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
|
||||
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b h1:m74UWYy+HBs+jMFR9mdZU6shPewugMyH5+GV6LNgW8w=
|
||||
@@ -80,11 +97,21 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
31
vendor/github.com/apex/log/interface.go
generated
vendored
31
vendor/github.com/apex/log/interface.go
generated
vendored
@@ -1,19 +1,22 @@
|
||||
package log
|
||||
|
||||
import "time"
|
||||
|
||||
// Interface represents the API of both Logger and Entry.
|
||||
type Interface interface {
|
||||
WithFields(fields Fielder) *Entry
|
||||
WithField(key string, value interface{}) *Entry
|
||||
WithError(err error) *Entry
|
||||
Debug(msg string)
|
||||
Info(msg string)
|
||||
Warn(msg string)
|
||||
Error(msg string)
|
||||
Fatal(msg string)
|
||||
Debugf(msg string, v ...interface{})
|
||||
Infof(msg string, v ...interface{})
|
||||
Warnf(msg string, v ...interface{})
|
||||
Errorf(msg string, v ...interface{})
|
||||
Fatalf(msg string, v ...interface{})
|
||||
Trace(msg string) *Entry
|
||||
WithFields(Fielder) *Entry
|
||||
WithField(string, interface{}) *Entry
|
||||
WithDuration(time.Duration) *Entry
|
||||
WithError(error) *Entry
|
||||
Debug(string)
|
||||
Info(string)
|
||||
Warn(string)
|
||||
Error(string)
|
||||
Fatal(string)
|
||||
Debugf(string, ...interface{})
|
||||
Infof(string, ...interface{})
|
||||
Warnf(string, ...interface{})
|
||||
Errorf(string, ...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Trace(string) *Entry
|
||||
}
|
||||
|
7
vendor/github.com/apex/log/logger.go
generated
vendored
7
vendor/github.com/apex/log/logger.go
generated
vendored
@@ -3,6 +3,7 @@ package log
|
||||
import (
|
||||
stdlog "log"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
// assert interface compliance.
|
||||
@@ -74,6 +75,12 @@ func (l *Logger) WithField(key string, value interface{}) *Entry {
|
||||
return NewEntry(l).WithField(key, value)
|
||||
}
|
||||
|
||||
// WithDuration returns a new entry with the "duration" field set
|
||||
// to the given duration in milliseconds.
|
||||
func (l *Logger) WithDuration(d time.Duration) *Entry {
|
||||
return NewEntry(l).WithDuration(d)
|
||||
}
|
||||
|
||||
// WithError returns a new entry with the "error" set to `err`.
|
||||
func (l *Logger) WithError(err error) *Entry {
|
||||
return NewEntry(l).WithError(err)
|
||||
|
8
vendor/github.com/apex/log/pkg.go
generated
vendored
8
vendor/github.com/apex/log/pkg.go
generated
vendored
@@ -1,5 +1,7 @@
|
||||
package log
|
||||
|
||||
import "time"
|
||||
|
||||
// singletons ftw?
|
||||
var Log Interface = &Logger{
|
||||
Handler: HandlerFunc(handleStdLog),
|
||||
@@ -38,6 +40,12 @@ func WithField(key string, value interface{}) *Entry {
|
||||
return Log.WithField(key, value)
|
||||
}
|
||||
|
||||
// WithDuration returns a new entry with the "duration" field set
|
||||
// to the given duration in milliseconds.
|
||||
func WithDuration(d time.Duration) *Entry {
|
||||
return Log.WithDuration(d)
|
||||
}
|
||||
|
||||
// WithError returns a new entry with the "error" set to `err`.
|
||||
func WithError(err error) *Entry {
|
||||
return Log.WithError(err)
|
||||
|
Reference in New Issue
Block a user