我正在尝试调试我的自定义 javamail IMAPCommand
。
在构造发送到 IMAP 服务器的命令的过程中,我做了这样的事情:
public Object doCommand(IMAPProtocol p) throws ProtocolException {
Argument args = new Argument();
Argument sortCrit = new Argument();
sortCrit.writeString("REVERSE");
sortCrit.writeString("DATE");
args.writeArgument(sortCrit);
args.writeString("UTF-8");
Argument from1 = new Argument();
from1.writeString("FROM");
from1.writeString(searchFrom.get(0));
Argument from2 = new Argument();
from2.writeString("FROM");
from2.writeString(searchFrom.get(1));
fromArg.writeString("OR");
fromArg.writeArgument(from1);
fromArg.writeArgument(from2);
args.writeArgument(fromArg);
Response[] r = p.command("UID SORT", args);
Response response = r[r.length - 1];
[...]
}
我想记录(例如,到 stderr)将发送到服务器的内容p.command
。我怎么做?