From 38e273597c283e607fd58199ed77890813f7c22c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 23 Feb 2017 18:30:32 +0100 Subject: log: log full level names instead of mispelled "EROR", "DBUG" --- log/logger.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'log/logger.go') diff --git a/log/logger.go b/log/logger.go index a7f7d9df7..15c83a9b2 100644 --- a/log/logger.go +++ b/log/logger.go @@ -24,7 +24,27 @@ const ( LvlTrace ) -// Returns the name of a Lvl +// Aligned returns a 5-character string containing the name of a Lvl. +func (l Lvl) AlignedString() string { + switch l { + case LvlTrace: + return "TRACE" + case LvlDebug: + return "DEBUG" + case LvlInfo: + return "INFO " + case LvlWarn: + return "WARN " + case LvlError: + return "ERROR" + case LvlCrit: + return "CRIT " + default: + panic("bad level") + } +} + +// Strings returns the name of a Lvl. func (l Lvl) String() string { switch l { case LvlTrace: -- cgit v1.2.3