From 039f5cf785e8ef4d5f6333bdd312fb26a7d5d797 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Tue, 18 Sep 2018 00:17:07 +0200 Subject: [PATCH] Use interface for logger. (#639) --- log/logger.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/log/logger.go b/log/logger.go index 101a2c99..22ec98f0 100644 --- a/log/logger.go +++ b/log/logger.go @@ -6,7 +6,17 @@ import ( ) // Logger is an optional custom logger. -var Logger = log.New(os.Stdout, "", log.LstdFlags) +var Logger StdLogger = log.New(os.Stdout, "", log.LstdFlags) + +// StdLogger interface for Standard Logger. +type StdLogger interface { + Fatal(args ...interface{}) + Fatalln(args ...interface{}) + Fatalf(format string, args ...interface{}) + Print(args ...interface{}) + Println(args ...interface{}) + Printf(format string, args ...interface{}) +} // Fatal writes a log entry. // It uses Logger if not nil, otherwise it uses the default log.Logger.