kglog

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

README

kglog

Helper library required for klog/v2, glog and stdlib log to coexist

If you only need klog/v2 and stdlib log to coexist, please use https://github.com/gomodules/logs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(fs *pflag.FlagSet)

AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the same value as the global flags.

func FlushLogs

func FlushLogs()

FlushLogs flushes logs immediately.

func GlogSetter

func GlogSetter(val string) (string, error)

GlogSetter is a setter to set glog level.

func Init added in v0.0.3

func Init(rootCmd *cobra.Command, printFlags bool)

Init initializes logs the way we want for AppsCode codebase.

func InitKlog added in v0.0.3

func InitKlog(fs *pflag.FlagSet)

func InitLogs

func InitLogs()

InitLogs initializes logs the way we want for kubernetes.

func NewLogger

func NewLogger(prefix string) *log.Logger

NewLogger creates a new log.Logger which sends logs to klog.Info.

func WordSepNormalizeFunc added in v0.0.3

func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WordSepNormalizeFunc changes all flags that contain "_" separators

Types

type HTTPLogger added in v0.0.5

type HTTPLogger struct{}

HTTPLogger serves as a bridge between the standard log package and the klog package.

func (HTTPLogger) Write added in v0.0.5

func (writer HTTPLogger) Write(data []byte) (n int, err error)

Write implements the io.Writer interface.

type KlogWriter

type KlogWriter struct{}

KlogWriter serves as a bridge between the standard log package and the glog package.

func (KlogWriter) Write

func (writer KlogWriter) Write(data []byte) (n int, err error)

Write implements the io.Writer interface.

Jump to

Keyboard shortcuts

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