919293949596979899100101
String targetName = event.getTarget().getName(); Category cat = Category.getInstance(Target.class.getName()); if (event.getException() == null) { cat.info("Target \"" + targetName + "\" finished."); } else { cat.error("Target \"" + targetName + "\" finished with error.", event.getException()); } } }
118119120121122123124125126127128
Task task = event.getTask(); 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()); } } }
141142143144145146147148149150151
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:
156157158159160161162163164165166
break; case Project.MSG_DEBUG: cat.debug(event.getMessage()); break; default: cat.error(event.getMessage()); break; } } } }
7273747576777879808182
c.warn(message); } public static void error(String category,Object message) { Category c = Category.getInstance(category); c.error(message); } public static void warn(Object message, Throwable t) { category.warn(message, t); }
6061626364656667686970
cat.warn ("Message " + ++i); root.warn("Message " + i); cat.error("Message " + ++i); root.error("Message " + i); cat.log(Priority.FATAL, "Message " + ++i); root.log(Priority.FATAL, "Message " + i); Exception e = new Exception("Just testing");
70717273747576777879
Exception e = new Exception("Just testing"); cat.debug("Message " + ++i, e); root.debug("Message " + i, e); cat.error("Message " + ++i, e); root.error("Message " + i, e); Category.shutdown(); } }
106107108109110111112113114115116
if (initialized) { Category cat = Category.getInstance(Project.class.getName()); if (event.getException() == null) { cat.info("Build finished."); } else { cat.error("Build finished with error.", event.getException()); } } } /**
131132133134135136137138139140141
158159160161162163164165166167168