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/06/14 10:47:32 UTC

[camel-k] 01/02: chore(trait): Polish Logging trait documentation

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

commit d4e899b1c927507c60ce3bca9829129c75e900a7
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Jun 14 10:11:01 2021 +0200

    chore(trait): Polish Logging trait documentation
---
 deploy/traits.yaml                     | 14 +++++++-------
 docs/modules/traits/pages/logging.adoc | 12 ++++++------
 pkg/resources/resources.go             |  4 ++--
 pkg/trait/logging.go                   | 14 ++++++--------
 4 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/deploy/traits.yaml b/deploy/traits.yaml
index 5931218..64e7f7a 100755
--- a/deploy/traits.yaml
+++ b/deploy/traits.yaml
@@ -577,9 +577,9 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: This trait is used to control logging options (such as color and the
-    format). The logging backend is provided by Quarkus and configuration details
-    for things like the the log format can be found on https://quarkus.io/guides/logging
+  description: The Logging trait is used to configure Integration runtime logging
+    options (such as color and format). The logging backend is provided by Quarkus,
+    whose configuration is documented at https://quarkus.io/guides/logging.
   properties:
   - name: enabled
     type: bool
@@ -590,16 +590,16 @@ traits:
     description: Colorize the log output
   - name: format
     type: string
-    description: Log message format
+    description: Logs message format
   - name: level
     type: string
-    description: Adjust the log level for the integrations (defaults to INFO)
+    description: Adjust the logging level (defaults to INFO)
   - name: json
     type: bool
-    description: Output the log in json format
+    description: Output the logs in JSON
   - name: json-pretty-print
     type: bool
-    description: Enable "pretty printing" of the json log
+    description: Enable "pretty printing" of the JSON logs
 - name: master
   platform: false
   profiles:
diff --git a/docs/modules/traits/pages/logging.adoc b/docs/modules/traits/pages/logging.adoc
index b50ecd4..03bb6fb 100755
--- a/docs/modules/traits/pages/logging.adoc
+++ b/docs/modules/traits/pages/logging.adoc
@@ -1,8 +1,8 @@
 = Logging Trait
 
 // Start of autogenerated code - DO NOT EDIT! (description)
-This trait is used to control logging options (such as color and the format). The logging backend is provided by
-Quarkus and configuration details for things like the the log format can be found on https://quarkus.io/guides/logging
+The Logging trait is used to configure Integration runtime logging options (such as color and format).
+The logging backend is provided by Quarkus, whose configuration is documented at https://quarkus.io/guides/logging.
 
 
 This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
@@ -32,19 +32,19 @@ The following configuration options are available:
 
 | logging.format
 | string
-| Log message format
+| Logs message format
 
 | logging.level
 | string
-| Adjust the log level for the integrations (defaults to INFO)
+| Adjust the logging level (defaults to INFO)
 
 | logging.json
 | bool
-| Output the log in json format
+| Output the logs in JSON
 
 | logging.json-pretty-print
 | bool
-| Enable "pretty printing" of the json log
+| Enable "pretty printing" of the JSON logs
 
 |===
 
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index bec6ab4..d7e9c58 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -467,9 +467,9 @@ var assets = func() http.FileSystem {
 		"/traits.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "traits.yaml",
 			modTime:          time.Time{},
-			uncompressedSize: 39047,
+			uncompressedSize: 39013,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x7b\x73\x1c\x37\xf2\xd8\xff\xfa\x14\x28\xfe\x52\xc5\x47\xed\x0e\x29\x5f\x7c\xe7\x30\x51\xae\x68\x49\xbe\xa3\x6d\x49\x8c\xa8\xf3\x55\x4a\x71\xdd\x62\x67\x7a\x77\x21\x62\x80\x39\x00\x43\x6a\x9d\xca\x77\x4f\xa1\x1b\xaf\xd9\x1d\x92\x4b\xd9\x74\x99\xa9\xdc\xfd\x61\x91\x9c\x69\x34\x1a\x8d\x7e\x77\x8f\x33\x5c\x38\x7b\xfa\x6c\xca\x14\x6f\xe1\x94\xf1\xc5\x42\x28\xe1\xd6\xcf\x18\xeb\x24\x77\x0b\x6d\xda\x53\xb6\xe0\xd2\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x7b\x73\x1c\xb9\xf1\xd8\xff\xfa\x14\x28\xfe\x52\xc5\x47\xed\x0e\x29\x3b\x67\x5f\x98\x28\x2e\x9e\xa4\xb3\x79\xa7\x07\x23\xca\xe7\x4a\x29\x57\x5e\xec\x4c\xef\x2e\x44\x0c\x30\x06\x30\xa4\xd6\xa9\x7c\xf7\x14\xba\xf1\x9a\xdd\x21\xb9\xd4\x1d\xaf\x8e\xa9\xd8\x7f\x9c\x48\xce\x34\x1a\x8d\x46\xbf\xbb\xc7\x19\x2e\x9c\x3d\x7d\x36\x65\x8a\xb7\x70\xca\xf8\x62\x21\x94\x70\xeb\x67\x8c\x75\x92\xbb\x85\x36\xed\x29\x5b\x70\x69\x [...]
 		},
 	}
 	fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
diff --git a/pkg/trait/logging.go b/pkg/trait/logging.go
index 92b5f86..38771f9 100644
--- a/pkg/trait/logging.go
+++ b/pkg/trait/logging.go
@@ -36,21 +36,21 @@ const (
 	defaultLogLevel                        = "INFO"
 )
 
-// This trait is used to control logging options (such as color and the format). The logging backend is provided by
-// Quarkus and configuration details for things like the the log format can be found on https://quarkus.io/guides/logging
+// The Logging trait is used to configure Integration runtime logging options (such as color and format).
+// The logging backend is provided by Quarkus, whose configuration is documented at https://quarkus.io/guides/logging.
 //
 // +camel-k:trait=logging
 type loggingTrait struct {
 	BaseTrait `property:",squash"`
 	// Colorize the log output
 	Color *bool `property:"color" json:"color,omitempty"`
-	// Log message format
+	// Logs message format
 	Format string `property:"format" json:"format,omitempty"`
-	// Adjust the log level for the integrations (defaults to INFO)
+	// Adjust the logging level (defaults to INFO)
 	Level string `property:"level" json:"level,omitempty"`
-	// Output the log in json format
+	// Output the logs in JSON
 	Json *bool `property:"json" json:"json,omitempty"`
-	// Enable "pretty printing" of the json log
+	// Enable "pretty printing" of the JSON logs
 	JsonPrettyPrint *bool `property:"json-pretty-print" json:"jsonPrettyPrint,omitempty"`
 }
 
@@ -75,13 +75,11 @@ func (l loggingTrait) Configure(environment *Environment) (bool, error) {
 }
 
 func (l loggingTrait) Apply(environment *Environment) error {
-
 	if environment.IntegrationInPhase(v1.IntegrationPhaseInitialization) {
 		if *l.Json {
 			if environment.Integration.Status.Dependencies == nil {
 				environment.Integration.Status.Dependencies = make([]string, 0)
 			}
-
 			util.StringSliceUniqueAdd(&environment.Integration.Status.Dependencies, depQuarkusLoggingJson)
 		}