本文整理了Java中org.codehaus.groovy.tools.shell.IO.flush()
方法的一些代码示例,展示了IO.flush()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IO.flush()
方法的具体详情如下:
包路径:org.codehaus.groovy.tools.shell.IO
类名称:IO
方法名:flush
[英]Flush both output streams.
[中]刷新两个输出流。
代码示例来源:origin: org.codehaus.groovy/groovy
private void log(final String level, Object msg, Throwable cause) {
assert level != null;
assert msg != null;
if (io == null) {
synchronized (Logger.class) {
if (io == null) {
io = new IO();
}
}
}
// Allow the msg to be a Throwable, and handle it properly if no cause is given
if (cause == null) {
if (msg instanceof Throwable) {
cause = (Throwable) msg;
msg = cause.getMessage();
}
}
Color color = GREEN;
if (WARN.equals(level) || ERROR.equals(level)) {
color = RED;
}
io.out.println(ansi().a(INTENSITY_BOLD).fg(color).a(level).reset().a(" [").a(name).a("] ").a(msg));
if (cause != null) {
cause.printStackTrace(io.out);
}
io.flush();
}
代码示例来源:origin: org.kohsuke.droovy/groovy
io.flush();
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
io.flush();
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
io.flush();
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
private void log(final String level, Object msg, Throwable cause) {
assert level != null;
assert msg != null;
if (io == null) {
io = new IO();
}
// Allow the msg to be a Throwable, and handle it properly if no cause is given
if (cause == null) {
if (msg instanceof Throwable) {
cause = (Throwable) msg;
msg = cause.getMessage();
}
}
Color color = GREEN;
if (WARN.equals(level) || ERROR.equals(level)) {
color = RED;
}
io.out.println(ansi().a(INTENSITY_BOLD).a(color).a(level).reset().a(" [").a(name).a("] ").a(msg));
if (cause != null) {
cause.printStackTrace(io.out);
}
try {
io.flush();
} catch (IOException io) {
throw new RuntimeException(io);
}
}
内容来源于网络,如有侵权,请联系作者删除!