diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2022-01-31 20:17:31 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2022-01-31 20:25:19 +0300 |
commit | 4cf58de9bb7b109dddbc80adefe52cdf61328d0d (patch) | |
tree | dbc4c46eb64672e077305aebbe694acd1acf4828 /rpc/logger.go | |
parent | 35fee8155bb6835d372c364ef721077b0dcb9d38 (diff) |
Small refactoring
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{} |