logger

package
v0.91.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Logging library for the troubleshoot framework.

Logging levels TODO: Document me here => https://github.com/replicatedhq/troubleshoot/issues/1031

0: also the same as not using V() log progress related information within the framework. Logs within each component (collector/analyzers/etc) should not use this level.

1: High level logs within each component (collector/analyzers/etc) should use this level. A log such as "Ceph collector connected to the cluster" belongs here.

2: Everything else goes here. If you do not know which level to use, use this level.

The best approach is to always use V(2) then after testing your code as a whole, you can elevate the log level of the messages you find useful to V(1) or V(0).

Do not log errors in functions that return an error. Instead, return the error and let the caller log it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitKlog added in v0.72.0

func InitKlog(verbosity int)

InitKlog initializes klog with a specific verbosity. This is useful when we want to use klog in a library and we want to control the verbosity from the library's caller. We can use this in tests to print instrumented logs for example.

func InitKlogFlags added in v0.58.0

func InitKlogFlags(cmd *cobra.Command)

InitKlogFlags initializes klog flags and adds them to the cobra command.

func SetQuiet

func SetQuiet(quiet bool)

SetQuiet enables or disables klog logger.

func SetupLogger added in v0.58.0

func SetupLogger(v *viper.Viper)

SetupLogger sets up klog logger based on viper configuration.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL