Created
March 18, 2013 17:45
-
-
Save praveenpuglia/5189206 to your computer and use it in GitHub Desktop.
A Helper Class for java to for Logging purposes in much like android style.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.log4j.Logger; | |
public class LogHelper { | |
/** | |
* helper class d() to log debug level information. | |
*/ | |
public static void d(Class cls, String message) | |
{ | |
Logger log = Logger.getLogger(cls); | |
log.debug(message); | |
} | |
/** | |
* helper class i() to log info level information. | |
*/ | |
public static void i(Class cls, String message) | |
{ | |
Logger log = Logger.getLogger(cls); | |
log.info(message); | |
} | |
/** | |
* helper class w() to log warning level information. | |
*/ | |
public static void w(Class cls, String message) | |
{ | |
Logger log = Logger.getLogger(cls); | |
log.warn(message); | |
} | |
/** | |
* helper class e() to log error information. | |
*/ | |
public static void e(Class cls, String message) | |
{ | |
Logger log = Logger.getLogger(cls); | |
log.error(message); | |
} | |
/** | |
* helper class f() to log fatal level information. | |
*/ | |
public static void f(Class cls, String message) | |
{ | |
Logger log = Logger.getLogger(cls); | |
log.fatal(message); | |
} | |
/** | |
* helper class t() to log trace information. | |
*/ | |
public static void t(Class cls, String message) | |
{ | |
Logger log = Logger.getLogger(cls); | |
log.trace(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment