aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/logutils/logger.go
blob: 7df234744d7de9fc83a2e1f6bd8dd8cc9089ff6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package logutils

import (
	log "github.com/sirupsen/logrus"
)

func init() {
	// Log as JSON instead of the default ASCII formatter.
	log.SetFormatter(&log.JSONFormatter{})
}

func WithFields(msg string, fkey string, fvalue string) {
	log.WithFields(log.Fields{fkey: fvalue}).Error(msg)
}