📄 loggingtool.java
字号:
if (doDebug) { errorString("" + object); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param number int to concatenate to object */ public void error(Object object, int number) { if (doDebug) { errorString("" + object + number); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param number double to concatenate to object */ public void error(Object object, double number) { if (doDebug) { errorString("" + object + number); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param bool boolean to concatenate to object */ public void error(Object object, boolean bool) { if (doDebug) { errorString("" + object + bool); } } private void errorString(String string) { if (toSTDOUT) { printToSTDOUT("ERROR", string); } else { log4jLogger.error(string); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param object2 Object to apply toString() too and output */ public void error(Object object, Object object2) { if (doDebug) { errorString("" + object + object2); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output */ public void error(Object obj, Object obj2, Object obj3) { if (doDebug) { errorString("" + obj + obj2 + obj3); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output * @param obj4 Object to apply toString() too and output */ public void error(Object obj, Object obj2, Object obj3, Object obj4) { if (doDebug) { errorString("" + obj + obj2 + obj3 + obj4); } } /** * Shows ERROR output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output * @param obj4 Object to apply toString() too and output * @param obj5 Object to apply toString() too and output */ public void error(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) { if (doDebug) { errorString("" + obj + obj2 + obj3 + obj4 + obj5); } } /** * Shows FATAL output for the Object. It uses the toString() method. * * @param object Object to apply toString() too and output */ public void fatal(Object object) { if (doDebug) { if (toSTDOUT) { printToSTDOUT("FATAL", object.toString()); } else { log4jLogger.fatal("" + object.toString()); } } } /** * Shows INFO output for the Object. It uses the toString() method. * * @param object Object to apply toString() too and output */ public void info(Object object) { if (doDebug) { infoString("" + object); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param number int to concatenate to object */ public void info(Object object, int number) { if (doDebug) { infoString("" + object + number); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param number double to concatenate to object */ public void info(Object object, double number) { if (doDebug) { infoString("" + object + number); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param bool boolean to concatenate to object */ public void info(Object object, boolean bool) { if (doDebug) { infoString("" + object + bool); } } private void infoString(String string) { if (toSTDOUT) { printToSTDOUT("INFO", string); } else { log4jLogger.info(string); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param object2 Object to apply toString() too and output */ public void info(Object object, Object object2) { if (doDebug) { infoString("" + object + object2); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output */ public void info(Object obj, Object obj2, Object obj3) { if (doDebug) { infoString("" + obj + obj2 + obj3); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output * @param obj4 Object to apply toString() too and output */ public void info(Object obj, Object obj2, Object obj3, Object obj4) { if (doDebug) { infoString("" + obj + obj2 + obj3 + obj4); } } /** * Shows INFO output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output * @param obj4 Object to apply toString() too and output * @param obj5 Object to apply toString() too and output */ public void info(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) { if (doDebug) { infoString("" + obj + obj2 + obj3 + obj4 + obj5); } } /** * Shows WARN output for the Object. It uses the toString() method. * * @param object Object to apply toString() too and output */ public void warn(Object object) { if (doDebug) { warnString("" + object); } } private void warnString(String string) { if (toSTDOUT) { printToSTDOUT("WARN", string); } else { log4jLogger.warn(string); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param number int to concatenate to object */ public void warn(Object object, int number) { if (doDebug) { warnString("" + object + number); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param bool boolean to concatenate to object */ public void warn(Object object, boolean bool) { if (doDebug) { warnString("" + object + bool); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param number double to concatenate to object */ public void warn(Object object, double number) { if (doDebug) { warnString("" + object + number); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param object Object to apply toString() too and output * @param object2 Object to apply toString() too and output */ public void warn(Object object, Object object2) { if (doDebug) { warnString("" + object + object2); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output */ public void warn(Object obj, Object obj2, Object obj3) { if (doDebug) { warnString("" + obj + obj2 + obj3); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output * @param obj4 Object to apply toString() too and output */ public void warn(Object obj, Object obj2, Object obj3, Object obj4) { if (doDebug) { warnString("" + obj + obj2 + obj3 + obj4); } } /** * Shows WARN output for the given Object's. It uses the * toString() method to concatenate the objects. * * @param obj Object to apply toString() too and output * @param obj2 Object to apply toString() too and output * @param obj3 Object to apply toString() too and output * @param obj4 Object to apply toString() too and output * @param obj5 Object to apply toString() too and output */ public void warn(Object obj, Object obj2, Object obj3, Object obj4, Object obj5) { if (doDebug) { warnString("" + obj + obj2 + obj3 + obj4 + obj5); } } /** * Use this method for computational demanding debug info. * For example: * <pre> * if (logger.isDebugEnabled()) { * logger.info("The 1056389822th prime that is used is: ", * calculatePrime(1056389822)); * } * </pre> * * @return true, if debug is enabled */ public boolean isDebugEnabled() { return doDebug; } private void printToSTDOUT(String level, String message) { System.out.print(classname); System.out.print(" "); System.out.print(level); System.out.print(": "); System.out.println(message); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -