From 81f191fdcd347df0b7ae52e061c9ab39e88bdbb1 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Mon, 20 Sep 2021 11:06:47 +0200 Subject: store fileList compressed for now using zlib on a 556Mo dir: files: 1469447 o -> 207289 o size divided by 7 --- logger/logger.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'logger') diff --git a/logger/logger.go b/logger/logger.go index bc2b3c8..d6a8630 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -43,15 +43,19 @@ var ( defaultLogger *Logger ) +func newLoggers() [4]logger { + return [4]logger{ + log.New(os.Stderr, tagInfo, flags), + log.New(os.Stderr, tagWarning, flags), + log.New(os.Stderr, tagError, flags), + log.New(os.Stderr, tagFatal, flags), + } +} + // initialize resets defaultLogger. Which allows tests to reset environment. func initialize() { defaultLogger = &Logger{ - loggers: [4]logger{ - log.New(os.Stderr, tagInfo, flags), - log.New(os.Stderr, tagWarning, flags), - log.New(os.Stderr, tagError, flags), - log.New(os.Stderr, tagFatal, flags), - }, + loggers: newLoggers(), minSeverity: 0, } } @@ -68,12 +72,7 @@ func init() { // logger. func Init(level int) *Logger { l := Logger{ - loggers: [4]logger{ - log.New(os.Stderr, tagInfo, flags), - log.New(os.Stderr, tagWarning, flags), - log.New(os.Stderr, tagError, flags), - log.New(os.Stderr, tagFatal, flags), - }, + loggers: newLoggers(), minSeverity: sFatal - severity(level), initialized: true, } -- cgit v1.2.3