奇怪的黑莓日志 [英] Strange BlackBerry log
问题描述
我正在使用以下代码作为我的推送通知实现的一部分:
I am using the code below , as part of my push notifications implementation:
private static final String BPAS_URL = "http://pushapi.eval.blackberry.com";
private static final String APP_ID = "3582-M4687r9k9k836r980kO2395i32i66y11a34";
String registerUrl = formRegisterRequest(BPAS_URL, APP_ID, null) + ";deviceside=false;ConnectionType=mds-public";
System.out.println("\n\n\n !!msg registerBPAS URL is: "+ registerUrl + "\n\n");
其中:
private static String formRegisterRequest(String bpasUrl, String appId, String token) {
StringBuffer sb = new StringBuffer(bpasUrl);
sb.append("/mss/PD_subReg?");
sb.append("serviceid=").append(appId);
sb.append("&osversion=").append(DeviceInfo.getSoftwareVersion());
sb.append("&model=").append(DeviceInfo.getDeviceName());
if (token != null && token.length() > 0) {
sb.append("&").append(token);
}
return sb.toString();
}
我要打印的是这个:
!!msg registerBPAS URL is: http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=3582-M4687r9[0.0] k9k836r980kO2395i32i66y11a34&osversion=5.0.0.669&model=9520;deviceside=false;ConnectionType=mds-publ[0.0] ic
我不明白为什么.为什么URL中有spaces " "
,为什么有"[0.0]"
I cant understand why though. Why there are spaces " "
in the URL and why is there a "[0.0]"
从上面的代码中,我无法解释这种行为.
From the code above i cant explain this behavior.
我希望打印的是:
!!msg registerBPAS URL is: http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=3582-M4687r9k9k836r980kO2395i32i66y11a34&osversion=5.0.0.669&model=9520;deviceside=false;ConnectionType=mds-public
*如果有帮助,我没有启用BIS,但我认为这并不重要,因为我是在本地形成URL.
*I dont have BIS enabled if this is any help , but i dont think it matters as i am forming the URL locally.
推荐答案
您看到的只是在几个地方的日志中有一个额外的[0.0]
.
All you're seeing is an extra [0.0]
in your log in a couple places.
这很正常,您的网址很好.
呼叫
System.out.println("");
不授予您排他性或 atomic 访问stdout
的权限.换句话说,当日志打印出传递给println()
的字符串时,您还可以将这些令牌以及来自BlackBerry OS的其他消息打印到日志中,并且可能/将它们放置在日志的中间.您的日志输出.
does not give you exclusive, or atomic, access to stdout
. In other words, while the log is printing out the String you passed to println()
, you can also get these tokens printed to the log, and other messages from the BlackBerry OS, and they may/will be placed right in the middle of your log output.
这很烦人,但是您的代码没有错.
It's annoying, but there's nothing wrong with your code.
如果需要其他选项,请查看BlackBerry EventLogger API ,它会写入日志,您可以从设备中拉出 ,然后搜索您的邮件,而无需烦人的[0.0]
.
If you want another option, look at the BlackBerry EventLogger API, which writes to a log that you can pull off the device, and search through for your messages, without the annoying [0.0]
.
这篇关于奇怪的黑莓日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!