Package org.apache.log4j

Examples of org.apache.log4j.Category.error()


                    break;
                case Project.MSG_DEBUG:
                    cat.debug(event.getMessage());
                    break;
                default:
                    cat.error(event.getMessage());
                    break;
            }
        }
    }
}
View Full Code Here


            Category cat = Category.getInstance(Project.class.getName());
            if (event.getException() == null) {
                cat.info("Build finished.");
            }
            else {
                cat.error("Build finished with error.", event.getException());
            }
        }  
    }
   
    public void targetStarted(BuildEvent event) {
View Full Code Here

            Category cat = Category.getInstance(Target.class.getName());
            if (event.getException() == null) {
                cat.info("Target \"" + event.getTarget().getName() + "\" finished.");
            }
            else {
                cat.error("Target \"" + event.getTarget().getName() + "\" finished with error.", event.getException());
            }
        }
    }
   
    public void taskStarted(BuildEvent event) {
View Full Code Here

            Category cat = Category.getInstance(task.getClass().getName());
            if (event.getException() == null) {
                cat.info("Task \"" + task.getTaskName() + "\" finished.");
            }
            else {
                cat.error("Task \"" + task.getTaskName() + "\" finished with error.", event.getException());
            }
        }
    }
   
    public void messageLogged(BuildEvent event) {
View Full Code Here

            }
           
            Category cat = Category.getInstance(categoryObject.getClass().getName());
            switch (event.getPriority()) {
                case Project.MSG_ERR:
                    cat.error(event.getMessage());
                    break;
                case Project.MSG_WARN:
                    cat.warn(event.getMessage());
                    break;
                case Project.MSG_INFO:
View Full Code Here

                    break;
                case Project.MSG_DEBUG:
                    cat.debug(event.getMessage());
                    break;
                default:                       
                    cat.error(event.getMessage());
                    break;
            }
        }
    }
}
View Full Code Here

   
                   assertEquals(ca.counter, 0);
    ab.debug(MSG); assertEquals(ca.counter, 1);
    ab.info(MSG);  assertEquals(ca.counter, 2);
    ab.warn(MSG);  assertEquals(ca.counter, 3);
    ab.error(MSG); assertEquals(ca.counter, 4);   
   

  }

  /**
 
View Full Code Here

    BasicConfigurator.disableInfo();
    root.debug(MSG); assertEquals(caRoot.counter, 3)
    root.info(MSG); assertEquals(caRoot.counter, 3)
    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 4)
    root.error(MSG); assertEquals(caRoot.counter, 5)
    root.log(Priority.ERROR, MSG); assertEquals(caRoot.counter, 6)

    BasicConfigurator.disableAll();
    root.debug(MSG); assertEquals(caRoot.counter, 6)
    root.info(MSG); assertEquals(caRoot.counter, 6)
View Full Code Here

    BasicConfigurator.disableAll();
    root.debug(MSG); assertEquals(caRoot.counter, 6)
    root.info(MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 6)
    root.error(MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)

    BasicConfigurator.disable(Priority.FATAL);
    root.debug(MSG); assertEquals(caRoot.counter, 6)
View Full Code Here

    BasicConfigurator.disable(Priority.FATAL);
    root.debug(MSG); assertEquals(caRoot.counter, 6)
    root.info(MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 6)
    root.error(MSG); assertEquals(caRoot.counter, 6);
    root.log(Priority.ERROR, MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)
  }

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.