jline.internal.Log.logWithJul()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中jline.internal.Log.logWithJul()方法的一些代码示例,展示了Log.logWithJul()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.logWithJul()方法的具体详情如下:
包路径:jline.internal.Log
类名称:Log
方法名:logWithJul

Log.logWithJul介绍

暂无

代码示例

代码示例来源:origin: jline/jline

@TestAccessible
static void log(final Level level, final Object... messages) {
  if (useJul) {
    logWithJul(level, messages);
    return;
  }
  //noinspection SynchronizeOnNonFinalField
  synchronized (output) {
    output.format("[%s] ", level);
    for (int i=0; i<messages.length; i++) {
      // Special handling for the last message if its a throwable, render its stack on the next line
      if (i + 1 == messages.length && messages[i] instanceof Throwable) {
        output.println();
        ((Throwable)messages[i]).printStackTrace(output);
      }
      else {
        render(output, messages[i]);
      }
    }
    output.println();
    output.flush();
  }
}

代码示例来源:origin: com.typesafe.sbt/incremental-compiler

@TestAccessible
static void log(final Level level, final Object... messages) {
  if (useJul) {
    logWithJul(level, messages);
    return;
  }
  //noinspection SynchronizeOnNonFinalField
  synchronized (output) {
    output.format("[%s] ", level);
    for (int i=0; i<messages.length; i++) {
      // Special handling for the last message if its a throwable, render its stack on the next line
      if (i + 1 == messages.length && messages[i] instanceof Throwable) {
        output.println();
        ((Throwable)messages[i]).printStackTrace(output);
      }
      else {
        render(output, messages[i]);
      }
    }
    output.println();
    output.flush();
  }
}

相关文章