diff options
Diffstat (limited to 'rpc/logger.go')
-rw-r--r-- | rpc/logger.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rpc/logger.go b/rpc/logger.go new file mode 100644 index 0000000..25fe2d6 --- /dev/null +++ b/rpc/logger.go @@ -0,0 +1,20 @@ +package rpc + +import "log" + +type Logger interface { + Logf(format string, args ...interface{}) +} + +type nopLogger struct{} + +func (n nopLogger) Logf(format string, args ...interface{}) { +} + +type stdLogger struct{} + +func (n stdLogger) Logf(format string, args ...interface{}) { + log.Printf(format, args...) +} + +var StdLogger = stdLogger{} |