View Javadoc
1 package org.jdiseq.util; 2 3 import java.util.logging.Logger; 4 5 /*** 6 * Log class wrapping the logging mechanism used by jDiSeq. 7 * Uses delegation pattern. 8 * @author Trond Andersen <trondandersen@c2i.net> 9 * @version $Id: Log.java,v 1.6 2003/07/22 17:58:11 trondandersen Exp $ 10 * @since 1.0 11 */ 12 public class Log { 13 14 /*** Singleton instance of class */ 15 private static Log instance = new Log(); 16 17 /*** Actual log instance */ 18 private final Logger logger = Logger.getLogger("org.jdiseq"); 19 20 /*** 21 * Returns the log instance. 22 * @return log instance 23 */ 24 public static Log getLog() { 25 return instance; 26 } 27 28 /*** 29 * Private constructor to avoid several instances 30 */ 31 private Log() { } 32 33 34 /*** 35 * Logs a severe error situation. 36 * @param message to be logged 37 */ 38 public void severe(String message) { 39 logger.severe(message); 40 } 41 42 /*** 43 * Logs an information message. 44 * @param message information to be logged 45 */ 46 public void info(String message) { 47 logger.info(message); 48 } 49 50 /*** 51 * Logs a warning message. 52 * @param message warning to be logged 53 */ 54 public void warn(String message) { 55 logger.warning(message); 56 } 57 58 /*** 59 * Logs that the program throws an exception. 60 * @param sourceClass class which creates the exception 61 * @param sourceMethod method which creates the exception 62 * @param throwable the exception being thrown 63 */ 64 public void throwing(String sourceClass, String sourceMethod, Throwable throwable) { 65 logger.throwing(sourceClass, sourceMethod, throwable); 66 } 67 68 /*** 69 * Logs a configuration setting. 70 * @param message configuration setting being set 71 */ 72 public void config(String message) { 73 logger.config(message); 74 } 75 76 /*** 77 * Logs that a thread is entering a method. 78 * @param sourceClass class which is entered 79 * @param sourceMethod method which is entered 80 */ 81 public void entering(String sourceClass, String sourceMethod) { 82 logger.entering(sourceClass, sourceMethod); 83 } 84 85 /*** 86 * Logs that a thread is exiting a method. 87 * @param sourceClass class which is being exited 88 * @param sourceMethod method which is being exited 89 * @param result returned to the caller 90 */ 91 public void exiting(String sourceClass, String sourceMethod, Object result) { 92 logger.exiting(sourceClass, sourceMethod, result); 93 } 94 }

This page was automatically generated by Maven