aboutsummaryrefslogtreecommitdiff
path: root/logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'logger.go')
-rw-r--r--logger.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/logger.go b/logger.go
new file mode 100644
index 0000000..7907e4f
--- /dev/null
+++ b/logger.go
@@ -0,0 +1,20 @@
+package jsonrpc2
+
+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{}