Cordova污染日志与persistent.js add()

时间:2012-10-29 10:37:03

标签: cordova logging

我正在使用最新的phonegap / cordova版本2.1。当我这样做时,我在Eclipse logcat中的日志被代码污染了     var allItems = Item.all();

allItems.list(null, function (results) {
    results.forEach(function (r) {
        console.log(r.id+ " " + r.lat + " " + r.long + " " + r.state);
    });
});

我得到一个输出(对于100行)

10-29 10:56:13.270: I/Web Console(5961):     } function (value) {
10-29 10:56:13.270: I/Web Console(5961):         if (value === undefined) {
10-29 10:56:13.270: I/Web Console(5961):             return getterCallback();
10-29 10:56:13.270: I/Web Console(5961):         } else {
10-29 10:56:13.270: I/Web Console(5961):             setterCallback(value);
10-29 10:56:13.270: I/Web Console(5961):             return scope;
10-29 10:56:13.270: I/Web Console(5961):         }
10-29 10:56:13.270: I/Web Console(5961):     } function (value) {
10-29 10:56:13.270: I/Web Console(5961):         if (value === undefined) {
10-29 10:56:13.270: I/Web Console(5961):             return getterCallback();
10-29 10:56:13.270: I/Web Console(5961):         } else {
10-29 10:56:13.270: I/Web Console(5961):             setterCallback(value);
10-29 10:56:13.270: I/Web Console(5961):             return scope;
10-29 10:56:13.270: I/Web Console(5961):         }
10-29 10:56:13.270: I/Web Console(5961):     } function (value) {
10-29 10:56:13.270: I/Web Console(5961):         if (value === undefined) {
10-29 10:56:13.270: I/Web Console(5961):             return getterCallback();
10-29 10:56:13.270: I/Web Console(5961):         } else {
10-29 10:56:13.270: I/Web Console(5961):             setterCallback(value);
10-29 10:56:13.270: I/Web Console(5961):             return scope;
10-29 10:56:13.270: I/Web Console(5961):         }
10-29 10:56:13.270: I/Web Console(5961):     } at :1149822901       

1 个答案:

答案 0 :(得分:0)

解决方案是,对象是空的,因此返回了显示的函数,这是由persistance.js中的错误引起的:请参阅persistence.js add() function not working