Documentation ¶
Index ¶
- Constants
- func DescriptorAttrs(desc ocispec.Descriptor) []any
- func DescriptorGroup(desc ocispec.Descriptor) slog.Attr
- func ErrAttr(err error) slog.Attr
- func FlagErr(name string, err error)
- func OCIPlatformValue(plat *ocispec.Platform) slog.Attr
- func VersionAttrs(info version.Info) []slog.Attr
- func WithLogging(logger *slog.Logger, level slog.Level, opts *oras.CopyGraphOptions) oras.CopyGraphOptions
- func WithPersistentVerbosityFlags(cmd *cobra.Command, v *VerbosityOptions)
- type VerbosityOptions
Constants ¶
View Source
const ( LevelTrace = slog.LevelDebug * 2 // trace = double debug LevelVerbose = slog.LevelInfo - 1 // verbose = one step more verbose than info )
View Source
const ErrKey = "err"
ErrKey is the key used for errors in log/slog attributes.
Variables ¶
This section is empty.
Functions ¶
func DescriptorAttrs ¶
func DescriptorAttrs(desc ocispec.Descriptor) []any
DescriptorAttrs formats a descriptor as a list of attributes.
func DescriptorGroup ¶
func DescriptorGroup(desc ocispec.Descriptor) slog.Attr
DescriptorGroup formats an ocispec.Descriptor as a log/slog.Attr.
func OCIPlatformValue ¶
OCIPlatformValue formats an ocispec.Platform as a log/slog.Attr.
func VersionAttrs ¶ added in v0.2.0
VersionAttrs formats version info as a list of log/slog.Attr.
func WithLogging ¶
func WithLogging(logger *slog.Logger, level slog.Level, opts *oras.CopyGraphOptions) oras.CopyGraphOptions
WithLogging adds logging at level for the OnCopySkipped, PostCopy, and OnMounted functions.
func WithPersistentVerbosityFlags ¶ added in v0.2.0
func WithPersistentVerbosityFlags(cmd *cobra.Command, v *VerbosityOptions)
WithPersistentVerbosityFlags adds the debug, quiet, and verbose flags to the given command.
Types ¶
type VerbosityOptions ¶ added in v0.2.0
type VerbosityOptions struct { Debug int // number of --debug flags passed Quiet int // number of --quiet flags passed Verbose int // number of --verbose flags passed }
VerbosityOptions configures logger verbosity.
Click to show internal directories.
Click to hide internal directories.