mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-21 04:20:23 +00:00
c4f79d455f
As kubernetes 1.24.0 is released, updating kubernetes dependencies to 1.24.0 updates: #3086 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
35 lines
688 B
Go
35 lines
688 B
Go
package log
|
|
|
|
import (
|
|
stdlog "log"
|
|
"os"
|
|
)
|
|
|
|
// StdLogger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger
|
|
type StdLogger interface {
|
|
Print(v ...interface{})
|
|
Printf(format string, v ...interface{})
|
|
}
|
|
|
|
var Logger StdLogger
|
|
|
|
func init() {
|
|
// default Logger
|
|
SetLogger(stdlog.New(os.Stderr, "[restful] ", stdlog.LstdFlags|stdlog.Lshortfile))
|
|
}
|
|
|
|
// SetLogger sets the logger for this package
|
|
func SetLogger(customLogger StdLogger) {
|
|
Logger = customLogger
|
|
}
|
|
|
|
// Print delegates to the Logger
|
|
func Print(v ...interface{}) {
|
|
Logger.Print(v...)
|
|
}
|
|
|
|
// Printf delegates to the Logger
|
|
func Printf(format string, v ...interface{}) {
|
|
Logger.Printf(format, v...)
|
|
}
|