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

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

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

Log.setOutput介绍

暂无

代码示例

代码示例来源:origin: micronaut-projects/micronaut-core

/**
 * Create a console reader.
 *
 * @param systemIn The input stream
 * @return The console reader
 * @throws IOException if there is an error
 */
protected ConsoleReader createConsoleReader(InputStream systemIn) throws IOException {
  // need to swap out the output to avoid logging during init
  final PrintStream nullOutput = new PrintStream(new ByteArrayOutputStream());
  final PrintStream originalOut = Log.getOutput();
  try {
    Log.setOutput(nullOutput);
    ConsoleReader consoleReader = new ConsoleReader(systemIn, out);
    consoleReader.setExpandEvents(false);
    return consoleReader;
  } finally {
    Log.setOutput(originalOut);
  }
}

代码示例来源:origin: org.grails/grails-bootstrap

protected ConsoleReader createConsoleReader(InputStream systemIn) throws IOException {
  // need to swap out the output to avoid logging during init
  final PrintStream nullOutput = new PrintStream(new ByteArrayOutputStream());
  final PrintStream originalOut = Log.getOutput();
  try {
    Log.setOutput(nullOutput);
    ConsoleReader consoleReader = new ConsoleReader(systemIn, out);
    consoleReader.setExpandEvents(false);
    return consoleReader;
  } finally {
    Log.setOutput(originalOut);
  }
}

代码示例来源:origin: org.codehaus.izpack/izpack-util

/**
 * Constructs a <tt>Console</tt> with <tt>System.in</tt> and <tt>System.out</tt> as the I/O streams.
 */
public Console(InstallData installData, ConsolePrefs prefs)
{
  this.installData = installData;
  Log.setOutput(new PrintStream(new OutputStream() {
    @Override
    public void write(int b) throws IOException
    {
    }
  }));
  if (prefs.enableConsoleReader)
  {
    initConsoleReader();
  }
  if (consoleReader == null)
  {
    console = System.console();
  }
}

相关文章