mirror of
https://github.com/containers/podman.git
synced 2025-12-10 15:47:46 +08:00
vendor: update c/storage
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
7
vendor/github.com/Microsoft/hcsshim/internal/log/format.go
generated
vendored
7
vendor/github.com/Microsoft/hcsshim/internal/log/format.go
generated
vendored
@@ -9,13 +9,16 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
const TimeFormat = log.RFC3339NanoFixed
|
||||
// TimeFormat is [time.RFC3339Nano] with nanoseconds padded using
|
||||
// zeros to ensure the formatted time is always the same number of
|
||||
// characters.
|
||||
// Based on RFC3339NanoFixed from github.com/containerd/log
|
||||
const TimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
|
||||
|
||||
func FormatTime(t time.Time) string {
|
||||
return t.Format(TimeFormat)
|
||||
|
||||
5
vendor/github.com/Microsoft/hcsshim/internal/log/hook.go
generated
vendored
5
vendor/github.com/Microsoft/hcsshim/internal/log/hook.go
generated
vendored
@@ -6,7 +6,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/logfields"
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
@@ -30,7 +29,7 @@ type Hook struct {
|
||||
// An empty string disables formatting.
|
||||
// When disabled, the fall back will the JSON encoding, if enabled.
|
||||
//
|
||||
// Default is [github.com/containerd/containerd/log.RFC3339NanoFixed].
|
||||
// Default is [TimeFormat].
|
||||
TimeFormat string
|
||||
|
||||
// Duration format converts a [time.Duration] fields to an appropriate encoding.
|
||||
@@ -49,7 +48,7 @@ var _ logrus.Hook = &Hook{}
|
||||
|
||||
func NewHook() *Hook {
|
||||
return &Hook{
|
||||
TimeFormat: log.RFC3339NanoFixed,
|
||||
TimeFormat: TimeFormat,
|
||||
DurationFormat: DurationFormatString,
|
||||
AddSpanContext: true,
|
||||
}
|
||||
|
||||
12
vendor/github.com/Microsoft/hcsshim/internal/log/nopformatter.go
generated
vendored
Normal file
12
vendor/github.com/Microsoft/hcsshim/internal/log/nopformatter.go
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type NopFormatter struct{}
|
||||
|
||||
var _ logrus.Formatter = NopFormatter{}
|
||||
|
||||
// Format does nothing and returns a nil slice.
|
||||
func (NopFormatter) Format(*logrus.Entry) ([]byte, error) { return nil, nil }
|
||||
Reference in New Issue
Block a user