本文整理了Java中jline.internal.Log.debug()
方法的一些代码示例,展示了Log.debug()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.debug()
方法的具体详情如下:
包路径:jline.internal.Log
类名称:Log
方法名:debug
暂无
代码示例来源:origin: jline/jline
/**
* Whether or not to allow the use of the JNI console interaction.
*/
public void setDirectConsole(final boolean flag) {
this.directConsole = flag;
Log.debug("Direct console: ", flag);
}
代码示例来源:origin: jline/jline
protected synchronized void setAnsiSupported(final boolean supported) {
this.ansiSupported = supported;
Log.debug("Ansi supported: ", supported);
}
代码示例来源:origin: jline/jline
public synchronized void setEchoEnabled(final boolean enabled) {
this.echoEnabled = enabled;
Log.debug("Echo enabled: ", enabled);
}
代码示例来源:origin: jline/jline
private static Thread addHook(final Thread thread) {
Log.debug("Registering shutdown-hook: ", thread);
try {
Runtime.getRuntime().addShutdownHook(thread);
}
catch (AbstractMethodError e) {
// JDK 1.3+ only method. Bummer.
Log.debug("Failed to register shutdown-hook", e);
}
return thread;
}
代码示例来源:origin: jline/jline
private static void removeHook(final Thread thread) {
Log.debug("Removing shutdown-hook: ", thread);
try {
Runtime.getRuntime().removeShutdownHook(thread);
}
catch (AbstractMethodError e) {
// JDK 1.3+ only method. Bummer.
Log.debug("Failed to remove shutdown-hook", e);
}
catch (IllegalStateException e) {
// The VM is shutting down, not a big deal; ignore
}
}
代码示例来源:origin: jline/jline
/**
* @since 2.7
*/
public static void reset() {
Log.debug("Resetting");
properties = null;
// force new properties to load
getProperties();
}
代码示例来源:origin: jline/jline
private static void loadProperties(final URL url, final Properties props) throws IOException {
Log.debug("Loading properties from: ", url);
InputStream input = url.openStream();
try {
props.load(new BufferedInputStream(input));
}
finally {
try {
input.close();
}
catch (IOException e) {
// ignore
}
}
if (Log.DEBUG) {
Log.debug("Loaded properties:");
for (Map.Entry<Object,Object> entry : props.entrySet()) {
Log.debug(" ", entry.getKey(), "=", entry.getValue());
}
}
}
代码示例来源:origin: jline/jline
private static synchronized void runTasks() {
Log.debug("Running all shutdown-hook tasks");
// Iterate through copy of tasks list
for (Task task : tasks.toArray(new Task[tasks.size()])) {
Log.debug("Running task: ", task);
try {
task.run();
}
catch (Throwable e) {
Log.warn("Task failed", e);
}
}
tasks.clear();
}
代码示例来源:origin: jline/jline
public void run () {
Log.debug("NonBlockingInputStream start");
boolean needToShutdown = false;
boolean needToRead = false;
Log.debug("NonBlockingInputStream shutdown");
代码示例来源:origin: jline/jline
private boolean fetchConfig(String name) {
long currentTime = System.currentTimeMillis();
try {
// tty properties are cached so we don't have to worry too much about getting term width/height
if (config == null || currentTime - configLastFetched > 1000) {
config = get("-a");
}
} catch (Exception e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
Log.debug("Failed to query stty ", name, "\n", e);
if (config == null) {
return false;
}
}
// always update the last fetched time and try to parse the output
if (currentTime - configLastFetched > 1000) {
configLastFetched = currentTime;
}
return true;
}
代码示例来源:origin: jline/jline
public static synchronized <T extends Task> T add(final T task) {
checkNotNull(task);
// If not enabled ignore
if (!enabled) {
Log.debug("Shutdown-hook is disabled; not installing: ", task);
return task;
}
// Install the hook thread if needed
if (hook == null) {
hook = addHook(new Thread("JLine Shutdown Hook")
{
@Override
public void run() {
runTasks();
}
});
}
// Track the task
Log.debug("Adding shutdown-hook task: ", task);
tasks.add(task);
return task;
}
代码示例来源:origin: jline/jline
@Override
public String getOutputEncoding() {
int codepage = getConsoleOutputCodepage();
//http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html
String charsetMS = "ms" + codepage;
if (java.nio.charset.Charset.isSupported(charsetMS)) {
return charsetMS;
}
String charsetCP = "cp" + codepage;
if (java.nio.charset.Charset.isSupported(charsetCP)) {
return charsetCP;
}
Log.debug("can't figure out the Java Charset of this code page (" + codepage + ")...");
return super.getOutputEncoding();
}
代码示例来源:origin: jline/jline
private TerminalLineSettings(String ttyDevice, boolean unused) throws IOException, InterruptedException {
checkNotNull(ttyDevice);
this.sttyCommand = Configuration.getString(JLINE_STTY, DEFAULT_STTY);
this.shCommand = Configuration.getString(JLINE_SH, DEFAULT_SH);
this.ttyDevice = ttyDevice;
this.useRedirect = SUPPORTS_REDIRECT && DEFAULT_TTY.equals(ttyDevice);
this.initialConfig = get("-g").trim();
this.config = get("-a");
this.configLastFetched = System.currentTimeMillis();
Log.debug("Config: ", config);
// sanity check
if (config.length() == 0) {
throw new IOException(MessageFormat.format("Unrecognized stty code: {0}", config));
}
}
代码示例来源:origin: jline/jline
protected void loadKeys(String appName, URL inputrcUrl) {
keys = keyMaps.get(KeyMap.EMACS);
try {
InputStream input = inputrcUrl.openStream();
try {
loadKeys(input, appName);
Log.debug("Loaded user configuration: ", inputrcUrl);
}
finally {
try {
input.close();
} catch (IOException e) {
// Ignore
}
}
}
catch (IOException e) {
if (inputrcUrl.getProtocol().equals("file")) {
File file = new File(inputrcUrl.getPath());
if (file.exists()) {
Log.warn("Unable to read user configuration: ", inputrcUrl, e);
}
} else {
Log.warn("Unable to read user configuration: ", inputrcUrl, e);
}
}
}
代码示例来源:origin: jline/jline
events = WindowsSupport.readConsoleInput(1);
} catch (IOException e) {
Log.debug("read Windows console input error: ", e);
代码示例来源:origin: jline/jline
private static Properties initProperties() {
URL url = determineUrl();
Properties props = new Properties();
try {
loadProperties(url, props);
}
catch (FileNotFoundException e) {
// debug here and no stack trace, as this can happen normally if default jline.rc file is missing
Log.debug("Unable to read configuration: ", e.toString());
}
catch (IOException e) {
Log.warn("Unable to read configuration from: ", url, e);
}
return props;
}
代码示例来源:origin: jline/jline
String type = Configuration.getString(JLINE_TERMINAL, defaultType);
Log.debug("Creating terminal; type=", type);
Log.debug("Created Terminal: ", t);
代码示例来源:origin: jline/jline
Log.debug("Max width: ", maxWidth);
代码示例来源:origin: com.typesafe.sbt/incremental-compiler
/**
* Whether or not to allow the use of the JNI console interaction.
*/
public void setDirectConsole(final boolean flag) {
this.directConsole = flag;
Log.debug("Direct console: ", flag);
}
代码示例来源:origin: com.typesafe.sbt/incremental-compiler
/**
* @since 2.7
*/
public static void reset() {
Log.debug("Resetting");
properties = null;
// force new properties to load
getProperties();
}
内容来源于网络,如有侵权,请联系作者删除!