From ed136ca83e2bd68cc16e1564b31df90a231ecff5 Mon Sep 17 00:00:00 2001 From: Colin Henry Date: Sat, 22 Aug 2020 15:47:37 -0700 Subject: [PATCH] new logging package, just the essentials --- log/logger.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 log/logger.go diff --git a/log/logger.go b/log/logger.go new file mode 100644 index 0000000..75ba437 --- /dev/null +++ b/log/logger.go @@ -0,0 +1,15 @@ +package log + +// Logger is a loggin interface with only the essentials that a function that needs to log should care about. Compatible with standard Go logger. +type Logger interface { + Print(v ...interface{}) + Printf(format string, v ...interface{}) + Println(v ...interface{}) +} + +// None provides a logger that doesnt log anything +type None struct{} + +func (n None) Print(v ...interface{}) {} +func (n None) Printf(format string, v ...interface{}) {} +func (n None) Println(v ...interface{}) {}