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 2012/12/18 04:12:04 UTC

git commit: is Slf4jConfiguration.setLoggerFile(File) API useful?

Updated Branches:
  refs/heads/master 3849bbd46 -> e95060321


is Slf4jConfiguration.setLoggerFile(File) API useful?

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/e9506032
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/e9506032
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/e9506032

Branch: refs/heads/master
Commit: e950603218f6dcf45fdc8e456b2492a2d05ccb68
Parents: 3849bbd
Author: Hervé Boutemy <hb...@apache.org>
Authored: Tue Dec 18 04:11:57 2012 +0100
Committer: Hervé Boutemy <hb...@apache.org>
Committed: Tue Dec 18 04:11:57 2012 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/maven/cli/MavenCli.java   |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/e9506032/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 99ea11b..eb440e4 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -298,9 +298,9 @@ public class MavenCli
         }
     }    
 
-    //
-    // All logging is handled by SFL4J
-    //
+    /**
+     * configure logging
+     */
     private void logging( CliRequest cliRequest )
     {
         cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG );
@@ -327,7 +327,8 @@ public class MavenCli
         {
             File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
             logFile = resolveFile( logFile, cliRequest.workingDirectory );
-            slf4jConfiguration.setLoggerFile( logFile );
+
+            // redirect stdout and stderr to file
             try
             {
                 PrintStream ps = new PrintStream( new FileOutputStream( logFile ) );
@@ -340,6 +341,8 @@ public class MavenCli
                 // Ignore
                 //
             }
+
+            slf4jConfiguration.setLoggerFile( logFile ); // is it really useful? redirecting stdout/stderr isn't sufficient in all cases?
         }
 
         plexusLoggerManager = new Slf4jLoggerManager();