aboutsummaryrefslogtreecommitdiff
path: root/rpc/logger.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-01-31 20:17:31 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-01-31 20:25:19 +0300
commit4cf58de9bb7b109dddbc80adefe52cdf61328d0d (patch)
treedbc4c46eb64672e077305aebbe694acd1acf4828 /rpc/logger.go
parent35fee8155bb6835d372c364ef721077b0dcb9d38 (diff)
Small refactoring
Diffstat (limited to 'rpc/logger.go')
-rw-r--r--rpc/logger.go20
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{}