You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2023/06/19 07:01:54 UTC
[maven] 01/01: update logging documentation
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch logging-documentation
in repository https://gitbox.apache.org/repos/asf/maven.git
commit c9c4691041696e3b6d532fca95f3507631d5f0c8
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Mon Jun 19 09:01:41 2023 +0200
update logging documentation
---
maven-embedder/src/site/apt/logging.apt | 19 ++++++----------
maven-slf4j-provider/src/site/apt/index.apt | 35 +++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/maven-embedder/src/site/apt/logging.apt b/maven-embedder/src/site/apt/logging.apt
index 7ff312909..53385c77c 100644
--- a/maven-embedder/src/site/apt/logging.apt
+++ b/maven-embedder/src/site/apt/logging.apt
@@ -25,7 +25,7 @@
Maven Logging
- End-user logging documentation is available {{{/maven-logging.html}in Maven site}}.
+ {{{/maven-logging.html}End-user logging documentation}} is available {{{/maven-logging.html}in Maven site}}.
This documentation is focused on internal implementation details.
* Logging API
@@ -48,7 +48,7 @@ Maven Logging
* Logging Implementation
- Maven 3.1.0 ships bundled with {{{http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html}SLF4J simple logger}},
+ Maven 3.1.0 ships bundled with {{{http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html}SLF4J simple logger}} and since 3.5.0 {{{../maven-slf4j-provider/}Maven-customized <<<maven-slf4j-provider>>>}},
but is ready to use other logging implementations: SLF4J is responsible for loading the implementation, referred to as
{{{http://www.slf4j.org/manual.html#swapping}"SLF4J bindings"}}.
@@ -62,6 +62,8 @@ Maven Logging
{{{./apidocs/org/apache/maven/cli/logging/Slf4jConfigurationFactory.html}Slf4jConfigurationFactory}} /
{{{./apidocs/org/apache/maven/cli/logging/Slf4jConfiguration.html}Slf4jConfiguration}}.
+~~ TODO document META-INF/maven/slf4j-configuration.properties
+
* Getting Logger Instance
Starting with Maven 3.1.0, SLF4J Logger can be used directly. This technique can be used safely in Maven core
@@ -79,14 +81,7 @@ public class MyClass
* Logger Name
- Before Maven 3.1.0, with logging implementation done in Maven, logger name wasn't used by basic console logging implementation:
- they are as-is, without clear convention on when to pass logger from class to class or when to create a new logger.
-
- Starting with Maven 3.1.0, logging implementation can be of greatest use if logger names are well defined. This definition still
- needs to be defined and implemented:
-
- * classical "class name" pattern?
-
- * Maven-specific name hierarchy?
+ Logger name is basically the classical fully qualified class name: it's not visible by default, but can be activated (see user documentation).
- * a mix (some with class name, some with Maven-specific hierarchy)?
+ Notice that before Maven 3.1.0, with logger created by Maven, some code used to pass logger from class to class because it could not create a new logger:
+ discrepencies between logger name and actual class may happen.
diff --git a/maven-slf4j-provider/src/site/apt/index.apt b/maven-slf4j-provider/src/site/apt/index.apt
new file mode 100644
index 000000000..f07b364f4
--- /dev/null
+++ b/maven-slf4j-provider/src/site/apt/index.apt
@@ -0,0 +1,35 @@
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+ -----
+ About
+ -----
+ Hervé Boutemy
+ -----
+ 2023-06-19
+ -----
+
+Maven SLF4J Simple Provider
+
+ An extension to {{{https://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html}SLF4J Simple}} to add enhanced color support.
+
+ Color is managed by <<<MavenSimpleLogger>>>, created by <<<MavenSimpleLoggerFactory>>>, and injected by <<<StaticLoggerBinder>>>: everything else is
+ copied at build time from {{{https://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html}SLF4J Simple}}
+
+* See Also
+
+ * {{{../maven-embedder/logging.html}Maven Logging}}