Package org.apache.log4j

Examples of org.apache.log4j.Logger.debug()


    Category log4jCategory = Logger.getLogger("b");

    int n = 0;

    log4jLogger.trace("msg" +(n++));
    log4jLogger.debug("msg" +(n++));
    log4jLogger.info("msg" +(n++));
    log4jLogger.warn("msg" +(n++));
    log4jLogger.error("msg" +(n++));
    log4jLogger.fatal("msg" +(n++));
   
View Full Code Here


public class Trivial extends TestCase {

  public void testSmoke() {
    Logger l = Logger.getLogger("a");
    l.trace("t");
    l.debug("d");
    l.info("i");
    l.warn("w");
    l.error("e");
    l.fatal("f");
View Full Code Here

    l.error("e");
    l.fatal("f");

    Exception e = new Exception("testing");
    l.trace("t", e);
    l.debug("d", e);
    l.info("i", e);
    l.warn("w", e);
    l.error("e", e);
    l.fatal("f", e);
  }
View Full Code Here

      final Properties properties = indexWriter.properties();
      additionalProperties.setProperty( Index.PropertyKeys.SIZE, indexSize );
      additionalProperties.setProperty( Index.PropertyKeys.MAXDOCSIZE, maxDocSize );
      additionalProperties.setProperty( Index.PropertyKeys.OCCURRENCES, numberOfOccurrences );
      properties.addAll( additionalProperties );
      logger.debug( "Post-merge properties: " + new ConfigurationMap( properties ) );
      properties.save( outputBasename + DiskBasedIndex.PROPERTIES_EXTENSION );
    }
       
    final PrintStream stats = new PrintStream( new FileOutputStream ( outputBasename + DiskBasedIndex.STATS_EXTENSION ) );
    if ( ! metadataOnly ) indexWriter.printStats( stats );
View Full Code Here

     */ 
    public static void main(String[] args) throws ClassNotFoundException, IOException
    {
      PropertyConfigurator.configure (Constants.LOG4J_FILE);
      Logger logger = Logger.getLogger(TestTtypeClassifier.class.getName());
      logger.debug("Started TestCatClassifier");

      //*-- read the classification model
      String modelFile = Constants.TTYPE_CLASS_MODEL;
      ObjectInputStream oi = new ObjectInputStream( new FileInputStream(modelFile) );
      LMClassifier compiledClassifier = (LMClassifier) oi.readObject();
View Full Code Here

        //*-- for each file, find the best category using the classifier and compare with the
        //*-- designated category
    for (int j = 0; j < testingFiles.length; ++j)
         {
      String text = Files.readFromFile( new File(classDir, testingFiles[j]) );
      logger.debug("Testing on " + CATEGORIES[i] + File.separator + testingFiles[j]);
      JointClassification jc =  compiledClassifier.classifyJoint(text);
          confMatrix.increment(CATEGORIES[i], jc.bestCategory());
          logger.debug("Best Category: " + jc.bestCategory() );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
View Full Code Here

         {
      String text = Files.readFromFile( new File(classDir, testingFiles[j]) );
      logger.debug("Testing on " + CATEGORIES[i] + File.separator + testingFiles[j]);
      JointClassification jc =  compiledClassifier.classifyJoint(text);
          confMatrix.increment(CATEGORIES[i], jc.bestCategory());
          logger.debug("Best Category: " + jc.bestCategory() );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
          for (int k = 0; k < CATEGORIES.length; k++) sb.append(nf.format(jc.score(k)) + " ");
          logger.debug(sb);
     } //*-- end of inner for
View Full Code Here

          confMatrix.increment(CATEGORIES[i], jc.bestCategory());
          logger.debug("Best Category: " + jc.bestCategory() );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
          for (int k = 0; k < CATEGORIES.length; k++) sb.append(nf.format(jc.score(k)) + " ");
          logger.debug(sb);
     } //*-- end of inner for
    } //*-- end of outer for
     
      logger.info("--------------------------------------------");
      logger.info("- Results ");
View Full Code Here

     */ 
    public static void main(String[] args) throws ClassNotFoundException, IOException
    {
      PropertyConfigurator.configure (Constants.LOG4J_FILE);
      Logger logger = Logger.getLogger(TestMClassifier.class.getName());
      logger.debug("Started TestClassifier");

      //*-- read the classification model
      String modelFile = MUSTRU_HOME + File.separator + "data" + File.separator + "training" + File.separator + "tcat" + File.separator + "tcat_classifier";
      ObjectInputStream oi = new ObjectInputStream( new FileInputStream(modelFile) );
      LMClassifier compiledClassifier = (LMClassifier) oi.readObject();
View Full Code Here

        //*-- for each file, find the best category using the classifier and compare with the
        //*-- designated category
    for (int j=0; j < testingFiles.length; ++j)
         {
      String text = Files.readFromFile( new File(classDir, testingFiles[j]) );
      logger.debug("Testing on " + CATEGORIES[i] + File.separator + testingFiles[j]);
      JointClassification jc =  compiledClassifier.classifyJoint(text);
          confMatrix.increment(CATEGORIES[i], jc.bestCategory());
          logger.debug("Best Category: " + jc.bestCategory() );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.