You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/08/02 17:02:42 UTC

[camel-k] branch main updated: Forcelly set QUARKUS_LOG_CONSOLE_JSON to false if the trait is not provided (GH issue #2539)

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new 80bdbf5  Forcelly set QUARKUS_LOG_CONSOLE_JSON to false if the trait is not provided (GH issue #2539)
80bdbf5 is described below

commit 80bdbf58c4f0d5e8d9c58c62d229771f6832074d
Author: Otavio Rodolfo Piske <op...@redhat.com>
AuthorDate: Mon Aug 2 11:57:48 2021 +0200

    Forcelly set QUARKUS_LOG_CONSOLE_JSON to false if the trait is not provided (GH issue #2539)
---
 pkg/trait/logging.go     | 8 ++++++--
 pkg/trait/trait_types.go | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pkg/trait/logging.go b/pkg/trait/logging.go
index d092aac..808ce1c 100644
--- a/pkg/trait/logging.go
+++ b/pkg/trait/logging.go
@@ -90,8 +90,12 @@ func (l loggingTrait) Apply(environment *Environment) error {
 		if util.IsTrue(l.JsonPrettyPrint) {
 			envvar.SetVal(&environment.EnvVars, envVarQuarkusLogConsoleJsonPrettyPrint, True)
 		}
-	} else if util.IsNilOrTrue(l.Color) {
-		envvar.SetVal(&environment.EnvVars, envVarQuarkusLogConsoleColor, True)
+	} else {
+		envvar.SetVal(&environment.EnvVars, envVarQuarkusLogConsoleJson, False)
+
+		if util.IsNilOrTrue(l.Color) {
+			envvar.SetVal(&environment.EnvVars, envVarQuarkusLogConsoleColor, True)
+		}
 	}
 
 	return nil
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index f22e3d5..fc6d0f0 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -46,6 +46,7 @@ import (
 
 // True --
 const True = "true"
+const False = "false"
 
 var (
 	basePath                  = "/etc/camel"