Documentation ¶
Index ¶
- func AsJSON(o interface{}) fmt.Stringer
- func AsYAML(o interface{}) fmt.Stringer
- func AsYAMLDiff(old, new interface{}) fmt.Stringer
- func AsYAMLDiffWithScheme(old, new runtime.Object, scheme *runtime.Scheme) fmt.Stringer
- func AsYAMLWithScheme(obj runtime.Object, scheme *runtime.Scheme) fmt.Stringer
- func HandleError(log *Logger, printUsage bool, format string, a ...interface{})
- func Setup()
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsJSON ¶ added in v1.15.1
AsJSON returns a new stringer object that delays marshaling until the String method is called. For logging at higher verbosity levels, to avoid formatting when the output isn't going to be used.
func AsYAML ¶ added in v1.15.1
AsYAML returns a new stringer object that delays marshaling until the String method is called. For logging at higher verbosity levels, to avoid formatting when the output isn't going to be used. The primary use is for logging Kubernetes objects, but should also work with other types, like Go structs.
func AsYAMLDiff ¶ added in v1.15.1
AsYAMLDiff returns a new stringer object that delays marshaling and diffing until the String method is called. For logging at higher verbosity levels, to avoid formatting when the output isn't going to be used. The primary use is for comparing two Kubernetes objects, but should also work with other types, like Go structs. Does not do any object type or version conversion.
func AsYAMLDiffWithScheme ¶ added in v1.15.1
AsYAMLDiffWithScheme is similar to AsYAMLDiff, except it allows specifying which scheme to use to encode the objects, instead of defaulting to the global `core.Scheme`.
func AsYAMLWithScheme ¶ added in v1.15.1
AsYAMLWithScheme is similar to AsYAML, except it allows specifying which scheme to use to encode the object, instead of defaulting to the global `core.Scheme`.
func HandleError ¶
HandleError prints the error to the standard error, prints the usage if the `printUsage` flag is true, exports the error to the error file and exits the process with the exit code.
Types ¶
type Logger ¶
Logger embeds logr.Logger
func (*Logger) DeleteErrorFile ¶
func (l *Logger) DeleteErrorFile()
DeleteErrorFile deletes the error file.
func (*Logger) ExportError ¶
ExportError exports the error to the error file if --export-error is enabled.