本文整理汇总了Java中jline.internal.Log.debug方法的典型用法代码示例。如果您正苦于以下问题:Java Log.debug方法的具体用法?Java Log.debug怎么用?Java Log.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jline.internal.Log
的用法示例。
在下文中一共展示了Log.debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOutputEncoding
import jline.internal.Log; //导入方法依赖的package包/类
@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();
}
示例2: setAnsiSupported
import jline.internal.Log; //导入方法依赖的package包/类
protected synchronized void setAnsiSupported(final boolean supported) {
this.ansiSupported = supported;
Log.debug("Ansi supported: ", supported);
}
示例3: setEchoEnabled
import jline.internal.Log; //导入方法依赖的package包/类
public synchronized void setEchoEnabled(final boolean enabled) {
this.echoEnabled = enabled;
Log.debug("Echo enabled: ", enabled);
}
示例4: setDirectConsole
import jline.internal.Log; //导入方法依赖的package包/类
/**
* 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);
}
示例5: readConsoleInput
import jline.internal.Log; //导入方法依赖的package包/类
private byte[] readConsoleInput() {
// XXX does how many events to read in one call matter?
INPUT_RECORD[] events = null;
try {
events = WindowsSupport.readConsoleInput(1);
} catch (IOException e) {
Log.debug("read Windows console input error: ", e);
}
if (events == null) {
return new byte[0];
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < events.length; i++ ) {
KEY_EVENT_RECORD keyEvent = events[i].keyEvent;
//Log.trace(keyEvent.keyDown? "KEY_DOWN" : "KEY_UP", "key code:", keyEvent.keyCode, "char:", (long)keyEvent.uchar);
if (keyEvent.keyDown) {
if (keyEvent.uchar > 0) {
// support some C1 control sequences: ALT + [@-_] (and [a-z]?) => ESC <ascii>
// http://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_set
int altState = KEY_EVENT_RECORD.LEFT_ALT_PRESSED | KEY_EVENT_RECORD.RIGHT_ALT_PRESSED;
if (((keyEvent.uchar >= '@' && keyEvent.uchar <= '_') || (keyEvent.uchar >= 'a' && keyEvent.uchar <= 'z'))
&& (keyEvent.controlKeyState & altState) != 0) {
sb.append('\u001B'); // ESC
}
sb.append(keyEvent.uchar);
continue;
}
// virtual keycodes: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
// just add support for basic editing keys (no control state, no numpad keys)
String escapeSequence = null;
switch (keyEvent.keyCode) {
case 0x21: // VK_PRIOR PageUp
escapeSequence = "\u001B[5~";
break;
case 0x22: // VK_NEXT PageDown
escapeSequence = "\u001B[6~";
break;
case 0x23: // VK_END
escapeSequence = "\u001B[4~";
break;
case 0x24: // VK_HOME
escapeSequence = "\u001B[1~";
break;
case 0x25: // VK_LEFT
escapeSequence = "\u001B[D";
break;
case 0x26: // VK_UP
escapeSequence = "\u001B[A";
break;
case 0x27: // VK_RIGHT
escapeSequence = "\u001B[C";
break;
case 0x28: // VK_DOWN
escapeSequence = "\u001B[B";
break;
case 0x2D: // VK_INSERT
escapeSequence = "\u001B[2~";
break;
case 0x2E: // VK_DELETE
escapeSequence = "\u001B[3~";
break;
default:
break;
}
if (escapeSequence != null) {
for (int k = 0; k < keyEvent.repeatCount; k++) {
sb.append(escapeSequence);
}
}
} else {
// key up event
// support ALT+NumPad input method
if (keyEvent.keyCode == 0x12/*VK_MENU ALT key*/ && keyEvent.uchar > 0) {
sb.append(keyEvent.uchar);
}
}
}
return sb.toString().getBytes();
}