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

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

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

Log.trace介绍

暂无

代码示例

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

public void load(final File file) throws IOException {
  checkNotNull(file);
  if (file.exists()) {
    Log.trace("Loading history from: ", file);
    FileReader reader = null;
    try{
      reader = new FileReader(file);
      load(reader);
    } finally{
      if(reader != null){
        reader.close();
      }
    }
  }
}

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

public void purge() throws IOException {
    Log.trace("Purging history");

    clear();

    if (!file.delete()) {
      Log.warn("Failed to delete history file: ", file);
    }
  }
}

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

public void flush() throws IOException {
  Log.trace("Flushing history");
  if (!file.exists()) {
    File dir = file.getParentFile();
    if (!dir.exists() && !dir.mkdirs()) {
      Log.warn("Failed to create directory: ", dir);
    }
    if (!file.createNewFile()) {
      Log.warn("Failed to create file: ", file);
    }
  }
  PrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream(file)));
  try {
    for (Entry entry : this) {
      out.println(entry.value());
    }
  }
  finally {
    out.close();
  }
}

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

private String exec(final String... cmd) throws IOException, InterruptedException {
  checkNotNull(cmd);
  Log.trace("Running: ", cmd);
  Process p = null;
  if (useRedirect) {
    try {
      p = inheritInput(new ProcessBuilder(cmd)).start();
    } catch (Throwable t) {
      useRedirect = false;
    }
  }
  if (p == null) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < cmd.length; i++) {
      if (i > 0) {
        sb.append(' ');
      }
      sb.append(cmd[i]);
    }
    sb.append(" < ");
    sb.append(ttyDevice);
    p = new ProcessBuilder(shCommand, "-c", sb.toString()).start();
  }
  String result = waitAndCapture(p);
  Log.trace("Result: ", result);
  return result;
}

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

int c = reader.read();
if (c >= 0) {
  Log.trace("Keystroke: ", c);

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

public static synchronized Terminal create(String ttyDevice) {
  if (Log.TRACE) {
    Log.trace(new Throwable("CREATE MARKER"));

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

Log.trace("Completing ", buffer, " (pos=", cursor, ") with: ", candidates, ": offset=", pos);

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

/**
 * Possible states in which the current readline operation may be in.
 */
private static enum State {
  /**
   * The user is just typing away
   */
  NORMAL,
  /**
   * In the middle of a emacs seach
   */
  SEARCH,
  FORWARD_SEARCH,
  /**
   * VI "yank-to" operation ("y" during move mode)
   */
  VI_YANK_TO,
  /**
   * VI "delete-to" operation ("d" during move mode)
   */
  VI_DELETE_TO,
  /**
   * VI "change-to" operation ("c" during move mode)
   */
  VI_CHANGE_TO
}

代码示例来源:origin: usethesource/rascal

public void flush() throws IOException {
  Log.trace("Flushing history");
  try (PrintStream out = new PrintStream(reg.getOutputStream(loc, false))) {
    for (Entry entry : this) {
      out.println(entry.value());
    }
  }
}

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

public void purge() throws IOException {
    Log.trace("Purging history");

    clear();

    if (!file.delete()) {
      Log.warn("Failed to delete history file: ", file);
    }
  }
}

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

public void load(final File file) throws IOException {
  checkNotNull(file);
  if (file.exists()) {
    Log.trace("Loading history from: ", file);
    FileReader reader = null;
    try{
      reader = new FileReader(file);
      load(reader);
    } finally{
      if(reader != null){
        reader.close();
      }
    }
  }
}

代码示例来源:origin: usethesource/rascal

public void purge() throws IOException {
  Log.trace("Purging history");
  clear();
  reg.remove(loc);
}

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

public void flush() throws IOException {
  Log.trace("Flushing history");
  if (!file.exists()) {
    File dir = file.getParentFile();
    if (!dir.exists() && !dir.mkdirs()) {
      Log.warn("Failed to create directory: ", dir);
    }
    if (!file.createNewFile()) {
      Log.warn("Failed to create file: ", file);
    }
  }
  PrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream(file)));
  try {
    for (Entry entry : this) {
      out.println(entry.value());
    }
  }
  finally {
    out.close();
  }
}

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

private String exec(final String... cmd) throws IOException, InterruptedException {
  checkNotNull(cmd);
  Log.trace("Running: ", cmd);
  Process p = null;
  if (useRedirect) {
    try {
      p = inheritInput(new ProcessBuilder(cmd)).start();
    } catch (Throwable t) {
      useRedirect = false;
    }
  }
  if (p == null) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < cmd.length; i++) {
      if (i > 0) {
        sb.append(' ');
      }
      sb.append(cmd[i]);
    }
    sb.append(" < ");
    sb.append(ttyDevice);
    p = new ProcessBuilder(shCommand, "-c", sb.toString()).start();
  }
  String result = waitAndCapture(p);
  Log.trace("Result: ", result);
  return result;
}

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

int c = reader.read();
if (c >= 0) {
  Log.trace("Keystroke: ", c);

代码示例来源:origin: usethesource/rascal

public void load(final ISourceLocation loc) throws IOException {
  checkNotNull(loc);
  if (reg.exists(loc)) {
    Log.trace("Loading history from: ", loc);
    load(reg.getInputStream(loc));
  }
}

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

Log.trace("Completing ", buffer, " (pos=", cursor, ") with: ", candidates, ": offset=", pos);

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

public static synchronized Terminal create(String ttyDevice) {
  if (Log.TRACE) {
    Log.trace(new Throwable("CREATE MARKER"));

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

/**
 * Possible states in which the current readline operation may be in.
 */
private static enum State {
  /**
   * The user is just typing away
   */
  NORMAL,
  /**
   * In the middle of a emacs seach
   */
  SEARCH,
  FORWARD_SEARCH,
  /**
   * VI "yank-to" operation ("y" during move mode)
   */
  VI_YANK_TO,
  /**
   * VI "delete-to" operation ("d" during move mode)
   */
  VI_DELETE_TO,
  /**
   * VI "change-to" operation ("c" during move mode)
   */
  VI_CHANGE_TO
}

相关文章