func setLoggerOutputFormat(logger *lorg.Log, format outputFormat) { if format == outputFormatJSON { logger.SetOutput(&jsonOutputWriter{ stream: `stderr`, node: ``, output: os.Stderr, }) } }
func setLoggerStyle(logger *lorg.Log, style lorg.Formatter) { testLogger := lorg.NewLog() testLogger.SetFormat(style) buffer := &bytes.Buffer{} testLogger.SetOutput(buffer) testLogger.Debug(``) loggerFormattingBasicLength = len(strings.TrimSuffix( loreley.TrimStyles(buffer.String()), "\n", )) logger.SetFormat(style) logger.SetIndentLines(true) }
func setLoggerVerbosity(level verbosity, logger *lorg.Log) { logger.SetLevel(lorg.LevelWarning) switch { case level >= verbosityTrace: logger.SetLevel(lorg.LevelTrace) case level >= verbosityDebug: logger.SetLevel(lorg.LevelDebug) case level >= verbosityNormal: logger.SetLevel(lorg.LevelInfo) } }