提交 2a5a8a49 编写于 作者: S srr101

示例代码日志打印整改

Signed-off-by: Nsrr101 <songruirui1@huawei.com>
上级 be976d37
...@@ -102,7 +102,7 @@ let rdbStore; ...@@ -102,7 +102,7 @@ let rdbStore;
export default class DataShareExtAbility extends DataShareExtensionAbility { export default class DataShareExtAbility extends DataShareExtensionAbility {
insert(uri, valueBucket, callback) { insert(uri, valueBucket, callback) {
if (valueBucket === null) { if (valueBucket === null) {
console.info('invalid valueBuckets'); console.error('invalid valueBuckets');
return; return;
} }
rdbStore.insert(TBL_NAME, valueBucket, function (err, ret) { rdbStore.insert(TBL_NAME, valueBucket, function (err, ret) {
...@@ -277,7 +277,7 @@ let rdbStore; ...@@ -277,7 +277,7 @@ let rdbStore;
export default class DataShareExtAbility extends DataShareExtensionAbility { export default class DataShareExtAbility extends DataShareExtensionAbility {
batchInsert(uri, valueBuckets, callback) { batchInsert(uri, valueBuckets, callback) {
if (valueBuckets === null || valueBuckets.length === undefined) { if (valueBuckets === null || valueBuckets.length === undefined) {
console.info('invalid valueBuckets'); console.error('invalid valueBuckets');
return; return;
} }
rdbStore.batchInsert(TBL_NAME, valueBuckets, function (err, ret) { rdbStore.batchInsert(TBL_NAME, valueBuckets, function (err, ret) {
......
...@@ -27,7 +27,7 @@ let dataShareHelper; ...@@ -27,7 +27,7 @@ let dataShareHelper;
let uri = ("datashare:///com.samples.datasharetest.DataShare"); let uri = ("datashare:///com.samples.datasharetest.DataShare");
await dataShare.createDataShareHelper(this.context, uri, (err, data) => { await dataShare.createDataShareHelper(this.context, uri, (err, data) => {
if (err != undefined) { if (err != undefined) {
console.info("createDataShareHelper fail, error message : " + err); console.error("createDataShareHelper fail, error message : " + err);
} else { } else {
console.info("createDataShareHelper end, data : " + data); console.info("createDataShareHelper end, data : " + data);
dataShareHelper = data; dataShareHelper = data;
...@@ -39,10 +39,10 @@ let da = new dataSharePredicates.DataSharePredicates(); ...@@ -39,10 +39,10 @@ let da = new dataSharePredicates.DataSharePredicates();
let resultSet; let resultSet;
da.equalTo("name", "ZhangSan"); da.equalTo("name", "ZhangSan");
dataShareHelper.query(uri, da, columns).then((data) => { dataShareHelper.query(uri, da, columns).then((data) => {
console.log("query end, data : " + data); console.info("query end, data : " + data);
resultSet = data; resultSet = data;
}).catch((err) => { }).catch((err) => {
console.log("query fail, error message : " + err); console.error("query fail, error message : " + err);
}); });
``` ```
......
...@@ -587,7 +587,7 @@ try { ...@@ -587,7 +587,7 @@ try {
console.info("data length is:", data.length); console.info("data length is:", data.length);
dataShareHelper.publish(data, "com.acts.ohos.data.datasharetest", version, publishCallback); dataShareHelper.publish(data, "com.acts.ohos.data.datasharetest", version, publishCallback);
} catch (e) { } catch (e) {
console.info("publish error " + JSON.stringify(e)); console.error("publish error " + JSON.stringify(e));
} }
``` ```
...@@ -1217,7 +1217,7 @@ denormalizeUri(uri: string, callback: AsyncCallback&lt;string&gt;): void ...@@ -1217,7 +1217,7 @@ denormalizeUri(uri: string, callback: AsyncCallback&lt;string&gt;): void
let uri = ("datashare:///com.samples.datasharetest.DataShare"); let uri = ("datashare:///com.samples.datasharetest.DataShare");
dataShareHelper.denormalizeUri(uri, (err, data) => { dataShareHelper.denormalizeUri(uri, (err, data) => {
if (err !== undefined) { if (err !== undefined) {
console.info("denormalizeUri failed, error message : " + err); console.error("denormalizeUri failed, error message : " + err);
}else{ }else{
console.info("denormalizeUri = " + data); console.info("denormalizeUri = " + data);
} }
...@@ -1251,7 +1251,7 @@ let uri = ("datashare:///com.samples.datasharetest.DataShare"); ...@@ -1251,7 +1251,7 @@ let uri = ("datashare:///com.samples.datasharetest.DataShare");
dataShareHelper.denormalizeUri(uri).then((data) => { dataShareHelper.denormalizeUri(uri).then((data) => {
console.info("denormalizeUri = " + data); console.info("denormalizeUri = " + data);
}).catch((err) => { }).catch((err) => {
console.info("denormalizeUri failed, error message : " + err); console.error("denormalizeUri failed, error message : " + err);
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册