Package com.firefly.utils.log

Examples of com.firefly.utils.log.LogItem


    this.name = name;
  }

  private void add(String str, String level, Throwable throwable,
      Object... objs) {
    LogItem item = new LogItem();
    item.setLevel(level);
    item.setName(name);
    item.setDate(SafeSimpleDateFormat.defaultDateFormat.format(new Date()));
    String content = StringUtils.replace(str, objs);
    if (throwable != null) {
      StringBuilder strBuilder = new StringBuilder();
      strBuilder.append(CL);
      for (StackTraceElement ele : throwable.getStackTrace()) {
        strBuilder.append(ele).append(CL);
      }
      content += strBuilder.toString();
    }
    item.setContent(content);
    if (consoleOutput)
      System.out.println(item.toString());
    if (fileOutput)
      LogFactory.getInstance().getLogTask().add(item);
  }
View Full Code Here


    this.name = name;
  }

  private void add(String str, String level, Throwable throwable,
      Object... objs) {
    LogItem item = new LogItem();
    item.setLevel(level);
    item.setName(name);
    item.setContent(str);
    item.setObjs(objs);
    item.setThrowable(throwable);
    if (consoleOutput)
      System.out.println(item.toString());
    if (fileOutput)
      LogFactory.getInstance().getLogTask().add(item);
  }
View Full Code Here

    this.name = name;
  }

  private void add(String str, String level, Throwable throwable,
      Object... objs) {
    LogItem item = new LogItem();
    item.setLevel(level);
    item.setName(name);
    item.setContent(str);
    item.setObjs(objs);
    item.setThrowable(throwable);
    if (consoleOutput) {
      item.setDate(SafeSimpleDateFormat.defaultDateFormat.format(new Date()));
      System.out.println(item.toString());
    }
    if (fileOutput)
      LogFactory.getInstance().getLogTask().add(item);
  }
View Full Code Here

TOP

Related Classes of com.firefly.utils.log.LogItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.