示例#1
0
  public static void main(String[] args) {
    AbstractLogger chainLogger = getLoggerChain();

    chainLogger.logMessage(AbstractLogger.DEBUG, "The system is set up.");
    chainLogger.logMessage(AbstractLogger.ERROR, "The coffee ran out");
    chainLogger.logMessage(AbstractLogger.INFO, "Karate of Geri is my Geri.");
    chainLogger.logMessage(AbstractLogger.DEBUG, "System shut down.");
  }
示例#2
0
  private static AbstractLogger getLoggerChain() {
    AbstractLogger errorLogger = new ErrorLogger(AbstractLogger.ERROR);
    AbstractLogger consoleLogger = new ConsoleLogger(AbstractLogger.INFO);
    AbstractLogger debugLogger = new FileLogger(AbstractLogger.DEBUG);

    errorLogger.setNextLogger(debugLogger);
    debugLogger.setNextLogger(consoleLogger);

    return errorLogger;
  }
示例#3
0
文件: MemLogger.java 项目: pnnl/svf
 /**
  * The text uses MessageFormat and will insert the following metrics:
  *
  * <p>Total Available GPU Memory: {0}
  *
  * <p>Current Available GPU Memory: {1}
  *
  * <p>Vendor name: {2}
  *
  * @param text The text to show in the logging message.
  */
 @Override
 public void setText(final String text) {
   super.setText(text);
 }