package klogr
import "k8s.io/klog/v2/klogr"
Package klogr implements github.com/go-logr/logr.Logger in terms of k8s.io/klog.
Index ¶
Functions ¶
func New ¶
New returns a logr.Logger which serializes output itself and writes it via klog.
func NewWithOptions ¶
NewWithOptions returns a logr.Logger which serializes as determined by the WithFormat option and writes via klog. The default is FormatKlog.
Types ¶
type Format ¶
type Format string
Format defines how log output is produced.
const ( // FormatSerialize tells klogr to turn key/value pairs into text itself // before invoking klog. FormatSerialize Format = "Serialize" // FormatKlog tells klogr to pass all text messages and key/value pairs // directly to klog. Klog itself then serializes in a human-readable // format and optionally passes on to a structure logging backend. FormatKlog Format = "Klog" )
type Option ¶
type Option func(*klogger)
Option is a functional option that reconfigures the logger created with New.
func WithFormat ¶
WithFormat selects the output format.
Source Files ¶
klogr.go
Directories ¶
Path | Synopsis |
---|---|
klogr/calldepth-test |
- Version
- v2.50.0
- Published
- Mar 15, 2022
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 6 hours ago –
Tools for package owners.