You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Sankaran, Nambi" <ns...@ebay.com> on 2013/01/25 07:35:54 UTC

google.inject logging while invoking org.codehaus.plexus.classworlds.launcher.Launcher

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?


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, annotation=@org.sonatype.inject.Parameters], source=org.codehaus.plexus.DefaultPlex

RE: google.inject logging while invoking org.codehaus.plexus.classworlds.launcher.Launcher

Posted by "Sankaran, Nambi" <ns...@ebay.com>.
Setting the loglevel on my application fixed the issue. 
Thank you Stuart.

-----Original Message-----
From: Stuart McCulloch [mailto:mcculls@gmail.com] 
Sent: Friday, January 25, 2013 6:14 AM
To: Maven Developers List
Subject: Re: google.inject logging while invoking org.codehaus.plexus.classworlds.launcher.Launcher

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, 
> annotation=@org.sonatype.inject.Parameters], 
> source=org.codehaus.plexus.DefaultPlex


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: google.inject logging while invoking org.codehaus.plexus.classworlds.launcher.Launcher

Posted by Stuart McCulloch <mc...@gmail.com>.
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, annotation=@org.sonatype.inject.Parameters], source=org.codehaus.plexus.DefaultPlex


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org