From d3466b9609c40650ce8bd6fd018fb98d1c8ca518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20BENO=C3=8ET?= Date: Sat, 13 Feb 2021 23:09:26 +0100 Subject: [PATCH] Fixed -q command line argument With logrus' default formatter it boils down to a choice between the colored version OR the human-unreadable list of fields, so the latter is preferable. --- README.md | 2 +- main.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9bf1f8b..3a05c4a 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ To Do * Proper logging, work in progress: * Sending logs to... well, Graylog... through CLI switches. - * Fix file output when quiet mode flag is specified. * Document command line flags. * Add TLS options (skip checks / specify CA) for the Graylog API. * Read object ownership using `grn_permissions` to preserve privileges on users' own objects * Support granting ownership on objects * Use goroutines ? Maybe. +* Custom log file/terminal output diff --git a/main.go b/main.go index 8c9565c..92d4714 100644 --- a/main.go +++ b/main.go @@ -86,6 +86,10 @@ func configureLogFile(path string) { // Configure the logging library based on the various command line flags. func configureLogging(flags cliFlags) { log = getLoggingContext(flags.instance) + log.Logger.SetFormatter(&logrus.TextFormatter{ + DisableColors: true, + FullTimestamp: true, + }) log.Logger.SetLevel(toLogLevel(flags.logLevel)) if flags.logFile != "" { configureLogFile(flags.logFile)