From 4c42e5520844243ba940a456a0c7014c38259f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=BF=97=E5=BC=BA?= Date: Fri, 27 Jul 2018 16:13:28 +0800 Subject: [PATCH] di for logger --- logger.go | 10 ++++++++++ qrpc.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 logger.go diff --git a/logger.go b/logger.go new file mode 100644 index 0000000..8c94f9a --- /dev/null +++ b/logger.go @@ -0,0 +1,10 @@ +package qrpc + +type logger interface { + Info(msg ...interface{}) + Error(msg ...interface{}) + Debug(msg ...interface{}) +} + +// Logger is exported logger interface +var Logger logger diff --git a/qrpc.go b/qrpc.go index a327b37..821f26f 100644 --- a/qrpc.go +++ b/qrpc.go @@ -11,7 +11,7 @@ const ( StreamFlag FrameFlag = 1 << iota // StreamEndFlag denotes the end of a stream StreamEndFlag - // StreamRstFlag is sent to request cancellation of a stream or to indicate that an error condition has occurred (TODO) + // StreamRstFlag is sent to request cancellation of a stream or to indicate that an error condition has occurred StreamRstFlag // NBFlag means it should be handled nonblockingly, it's implied for streamed frames NBFlag