mirror of https://github.com/apache/maven.git
added developer documentation about logging APIs
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1410815 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5869fc1197
commit
b1dbec59ab
|
@ -22,7 +22,7 @@
|
||||||
<artifactId>maven-embedder</artifactId>
|
<artifactId>maven-embedder</artifactId>
|
||||||
|
|
||||||
<name>Maven Embedder</name>
|
<name>Maven Embedder</name>
|
||||||
<description>Maven embeddable component, with CLI support.</description>
|
<description>Maven embeddable component, with CLI and logging support.</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -10,4 +10,8 @@ ${project.name}
|
||||||
|
|
||||||
${project.description}
|
${project.description}
|
||||||
|
|
||||||
See {{{./cli.html}CLI options}} reference.
|
* References
|
||||||
|
|
||||||
|
* {{{./cli.html}CLI options}},
|
||||||
|
|
||||||
|
* {{{./logging.html}logging API}}.
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
-----
|
||||||
|
Maven Logging
|
||||||
|
-----
|
||||||
|
Hervé Boutemy
|
||||||
|
-----
|
||||||
|
2012-04-29
|
||||||
|
-----
|
||||||
|
|
||||||
|
Maven Logging
|
||||||
|
|
||||||
|
Maven uses
|
||||||
|
{{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/package-summary.html}Plexus
|
||||||
|
Container logging API}}, like any other Plexus components, ie
|
||||||
|
{{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/LoggerManager.html}LoggerManager}}
|
||||||
|
/ {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/Logger.html}Logger}}.
|
||||||
|
|
||||||
|
Starting with Maven 3.1.0, instead of implementing the API itself,
|
||||||
|
Maven maps to {{{http://slf4j.org/apidocs/}SLF4J API}}'s {{{http://slf4j.org/apidocs/org/slf4j/ILoggerFactory.html}ILoggerFactory}}
|
||||||
|
/ {{{http://slf4j.org/apidocs/org/slf4j/Logger.html}Logger}} through
|
||||||
|
{{{./apidocs/org/apache/maven/cli/logging/Slf4jLoggerManager.html}Slf4jLoggerManager}}
|
||||||
|
/ {{{./apidocs/org/apache/maven/cli/logging/Slf4jLogger.html}Slf4jLogger}}.
|
||||||
|
|
||||||
|
* Getting Logger Instance
|
||||||
|
|
||||||
|
Plexus Logger can be injected in Plexus component using Plexus annotations
|
||||||
|
|
||||||
|
+------
|
||||||
|
import org.codehaus.plexus.logging.Logger;
|
||||||
|
import org.codehaus.plexus.component.annotations.Component;
|
||||||
|
import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
|
|
||||||
|
@Component( role = MyComponent.class )
|
||||||
|
public class DefaultMyComponent
|
||||||
|
implements MyComponent
|
||||||
|
{
|
||||||
|
@Requirement
|
||||||
|
private Logger logger;
|
||||||
|
}
|
||||||
|
+------
|
Loading…
Reference in New Issue