On Sep 2, 2008, at 10:34 AM, Thorbjørn Ravn Andersen wrote:

MY POI skrev  den 02-09-2008 14:34:
Thanks a lot..but here we are having hundreads of classes..

in this case any solution is there

This might help you getting started:

helpers/FooBar.java
=====
package helpers;

public class FooBar {
  public static void main(String[] args) {
      System.out.println("Hello World");
      System.out.println("Hello World");
org.slf4j.LoggerFactory.getLogger(Me.callerClass()).info("Hello World"); org.slf4j.LoggerFactory.getLogger(Me.callerClass()).info("Hello World");
  }
}


The suggestion introduces SLF4J into the mix with explanation and goes through a lot of effort to evaluate the class of the calling statement for categorization when the cost might be excessive. It would seem that if you replaced the System.println(...) with a call to something like:

com.example.MyApp.Log.println()

you could could either accomplish the exact same thing as your code or so something like:

public println(Object o) {
   Logger.getRootLogger().info(String.valueOf(o));
}

if you didn't care about categorization of messages,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to