mirror of
https://github.com/ceph/go-ceph
synced 2024-12-23 06:33:24 +00:00
72493ed2f7
This change adds two log packages. One for the external go-ceph consumers under common/log, and one for the internal use within the go-ceph code under internal/log. The external package exports two functions for consumers, SetWarnf() and SetDebugf(), that set a logger for warnings and debug messages respectively. They take a log.Printf compatible function as argument. The internal package exports these functions as Warnf() and Debugf(), which can be used by the go-ceph code to log warnings and debug messages. Signed-off-by: Sven Anderson <sven@redhat.com>
15 lines
506 B
Go
15 lines
506 B
Go
// Package log is the internal package for go-ceph logging. This package is only
|
|
// used from go-ceph code, not from consumers of go-ceph. go-ceph code uses the
|
|
// functions in this package to log information that can't be returned as
|
|
// errors. The functions default to no-ops and can be set with the external log
|
|
// package common/log by the go-ceph consumers.
|
|
package log
|
|
|
|
func noop(string, ...interface{}) {}
|
|
|
|
// These variables are set by the common log package.
|
|
var (
|
|
Warnf = noop
|
|
Debugf = noop
|
|
)
|