On 25 Jan 2013, at 06:35, Sankaran, Nambi wrote:

> Hi
> 
> I'm invoking maven through reflection by invoking the 'main' method on 
> 'org.codehaus.plexus.classworlds.launcher.Launcher' class. Maven itself works 
> fine.
> 
> But, it prints additional log messages to console, that are printed from 
> "com.google.inject" package.
> 
> Does anyone know how to disable these messages, while invoking 'Launcher' 
> through reflection?

This is debug logging from the container - I assume the application you're 
launching Maven from uses SLF4J and has the default log level set to DEBUG, 
which is then inherited by all code launched from that application. To disable 
these messages you need to set the log level for Sisu to INFO (or set the 
default log level to INFO) in whatever configuration file you use to configure 
your SLF4J backend. For example, if you were using logback:

  <configuration>
    <root level="DEBUG">
      <!-- ...etc... -->
    </root>
    <logger name="Sisu" level="INFO"/>
    <!-- ...etc... -->
  </configuration>

Some SLF4J backends also let you set the logger levels programatically, see the 
documentation for whichever implementation you're using.

> 2013-01-24 18:03:41 DEBUG Sisu     - Add publisher: 
> com.google.inject.internal.InjectorImpl@1c6ea37a
> 
> -----[explicit 
> bindings]-------------------------------------------------------
> 0. ProviderInstanceBinding{key=Key[type=com.google.inject.Injector, 
> annotation=[none]], source=[unknown source], scope=Scopes.NO_S
> COPE, provider=Provider<Injector>}
> 1. ProviderInstanceBinding{key=Key[type=java.util.logging.Logger, 
> annotation=[none]], source=[unknown source], scope=Scopes.NO_SCO
> PE, provider=Provider<Logger>}
> 2. ProviderInstanceBinding{key=Key[type=org.slf4j.Logger, annotation=[none]], 
> source=[unknown source], scope=Scopes.NO_SCOPE, prov
> ider=Provider<org.slf4j.Logger>}
> 3. InstanceBinding{key=Key[type=com.google.inject.Stage, annotation=[none]], 
> source=[unknown source], instance=DEVELOPMENT}
> 4. InstanceBinding{key=Key[type=org.codehaus.plexus.context.Context, 
> annotation=[none]], source=org.codehaus.plexus.DefaultPlexusC
> ontainer$ContainerModule.configure(DefaultPlexusContainer.java:800), 
> instance={plexus=org.codehaus.plexus.DefaultPlexusContainer@f
> 102963}}
> 5. InstanceBinding{key=Key[type=java.util.Map, 
> [email protected]], 
> source=org.codehaus.plexus.DefaultPlex


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to