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

示例代码日志打印整改

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