提交 1464c319 编写于 作者: zyjhandsome's avatar zyjhandsome

正常打印,统一修改为console.info

Signed-off-by: zyjhandsome's avatarzyjhandsome <zyjhandsome@126.com>
上级 a01be59f
...@@ -38,15 +38,15 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens ...@@ -38,15 +38,15 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens
class AccessibilityExtAbility extends AccessibilityExtensionAbility { class AccessibilityExtAbility extends AccessibilityExtensionAbility {
onConnect() { onConnect() {
console.log('AccessibilityExtAbility onConnect'); console.info('AccessibilityExtAbility onConnect');
} }
onDisconnect() { onDisconnect() {
console.log('AccessibilityExtAbility onDisconnect'); console.info('AccessibilityExtAbility onDisconnect');
} }
onAccessibilityEvent(accessibilityEvent) { onAccessibilityEvent(accessibilityEvent) {
console.log('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent)); console.info('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent));
} }
} }
...@@ -67,9 +67,9 @@ export default AccessibilityExtAbility; ...@@ -67,9 +67,9 @@ export default AccessibilityExtAbility;
```typescript ```typescript
onAccessibilityEvent(accessibilityEvent) { onAccessibilityEvent(accessibilityEvent) {
console.log('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent)); console.info('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent));
if (accessibilityEvent.eventType === 'pageStateUpdate') { if (accessibilityEvent.eventType === 'pageStateUpdate') {
console.log('AccessibilityExtAbility onAccessibilityEvent: pageStateUpdate'); console.info('AccessibilityExtAbility onAccessibilityEvent: pageStateUpdate');
// TODO: 自定义相关逻辑开发 // TODO: 自定义相关逻辑开发
} }
} }
......
...@@ -262,50 +262,50 @@ export default class EntryAbility extends UIAbility { ...@@ -262,50 +262,50 @@ export default class EntryAbility extends UIAbility {
let abilityLifecycleCallback = { let abilityLifecycleCallback = {
// 当UIAbility创建时被调用 // 当UIAbility创建时被调用
onAbilityCreate(uiAbility) { onAbilityCreate(uiAbility) {
console.log(TAG, `onAbilityCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onAbilityCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
}, },
// 当窗口创建时被调用 // 当窗口创建时被调用
onWindowStageCreate(uiAbility, windowStage: window.WindowStage) { onWindowStageCreate(uiAbility, windowStage: window.WindowStage) {
console.log(TAG, `onWindowStageCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onWindowStageCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
console.log(TAG, `onWindowStageCreate windowStage: ${JSON.stringify(windowStage)}`); console.info(TAG, `onWindowStageCreate windowStage: ${JSON.stringify(windowStage)}`);
}, },
// 当窗口处于活动状态时被调用 // 当窗口处于活动状态时被调用
onWindowStageActive(uiAbility, windowStage: window.WindowStage) { onWindowStageActive(uiAbility, windowStage: window.WindowStage) {
console.log(TAG, `onWindowStageActive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onWindowStageActive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
console.log(TAG, `onWindowStageActive windowStage: ${JSON.stringify(windowStage)}`); console.info(TAG, `onWindowStageActive windowStage: ${JSON.stringify(windowStage)}`);
}, },
// 当窗口处于非活动状态时被调用 // 当窗口处于非活动状态时被调用
onWindowStageInactive(uiAbility, windowStage: window.WindowStage) { onWindowStageInactive(uiAbility, windowStage: window.WindowStage) {
console.log(TAG, `onWindowStageInactive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onWindowStageInactive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
console.log(TAG, `onWindowStageInactive windowStage: ${JSON.stringify(windowStage)}`); console.info(TAG, `onWindowStageInactive windowStage: ${JSON.stringify(windowStage)}`);
}, },
// 当窗口被销毁时被调用 // 当窗口被销毁时被调用
onWindowStageDestroy(uiAbility, windowStage: window.WindowStage) { onWindowStageDestroy(uiAbility, windowStage: window.WindowStage) {
console.log(TAG, `onWindowStageDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onWindowStageDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
console.log(TAG, `onWindowStageDestroy windowStage: ${JSON.stringify(windowStage)}`); console.info(TAG, `onWindowStageDestroy windowStage: ${JSON.stringify(windowStage)}`);
}, },
// 当UIAbility被销毁时被调用 // 当UIAbility被销毁时被调用
onAbilityDestroy(uiAbility) { onAbilityDestroy(uiAbility) {
console.log(TAG, `onAbilityDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onAbilityDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
}, },
// 当UIAbility从后台转到前台时触发回调 // 当UIAbility从后台转到前台时触发回调
onAbilityForeground(uiAbility) { onAbilityForeground(uiAbility) {
console.log(TAG, `onAbilityForeground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onAbilityForeground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
}, },
// 当UIAbility从前台转到后台时触发回调 // 当UIAbility从前台转到后台时触发回调
onAbilityBackground(uiAbility) { onAbilityBackground(uiAbility) {
console.log(TAG, `onAbilityBackground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onAbilityBackground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
}, },
// 当UIAbility迁移时被调用 // 当UIAbility迁移时被调用
onAbilityContinue(uiAbility) { onAbilityContinue(uiAbility) {
console.log(TAG, `onAbilityContinue uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); console.info(TAG, `onAbilityContinue uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
} }
} }
// 获取应用上下文 // 获取应用上下文
let applicationContext = this.context.getApplicationContext(); let applicationContext = this.context.getApplicationContext();
// 注册应用内生命周期回调 // 注册应用内生命周期回调
this.lifecycleId = applicationContext.on('abilityLifecycle', abilityLifecycleCallback); this.lifecycleId = applicationContext.on('abilityLifecycle', abilityLifecycleCallback);
console.log(TAG, `register callback number: ${this.lifecycleId}`); console.info(TAG, `register callback number: ${this.lifecycleId}`);
} }
... ...
......
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
// 监听call事件所需的方法 // 监听call事件所需的方法
this.callee.on(MSG_SEND_METHOD, FunACall); this.callee.on(MSG_SEND_METHOD, FunACall);
} catch (error) { } catch (error) {
console.log(`${MSG_SEND_METHOD} register failed with error ${JSON.stringify(error)}`) console.info(`${MSG_SEND_METHOD} register failed with error ${JSON.stringify(error)}`)
} }
} }
... ...
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
export default class StaticSubscriber extends StaticSubscriberExtensionAbility { export default class StaticSubscriber extends StaticSubscriberExtensionAbility {
onReceiveEvent(event) { onReceiveEvent(event) {
console.log('onReceiveEvent, event:' + event.event); console.info('onReceiveEvent, event:' + event.event);
} }
} }
``` ```
......
...@@ -439,10 +439,10 @@ ...@@ -439,10 +439,10 @@
// 注册caller的协同场景下跨设备组件状态变化监听通知 // 注册caller的协同场景下跨设备组件状态变化监听通知
try { try {
caller.onRemoteStateChange((str) => { caller.onRemoteStateChange((str) => {
console.log('Remote state changed ' + str); console.info('Remote state changed ' + str);
}); });
} catch (error) { } catch (error) {
console.log('Caller.onRemoteStateChange catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}'); console.info('Caller.onRemoteStateChange catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
} }
} }
}).catch((error) => { }).catch((error) => {
......
...@@ -66,7 +66,7 @@ InputMethodExtensionAbility通过[InputMethodExtensionContext](../reference/apis ...@@ -66,7 +66,7 @@ InputMethodExtensionAbility通过[InputMethodExtensionContext](../reference/apis
} }
onDestroy() { onDestroy() {
console.log("onDestroy."); console.info("onDestroy.");
this.context.destroy(); this.context.destroy();
} }
} }
......
...@@ -115,7 +115,7 @@ export default class ServiceExtImpl extends IdlServiceExtStub { ...@@ -115,7 +115,7 @@ export default class ServiceExtImpl extends IdlServiceExtStub {
insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void { insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void {
// 开发者自行实现业务逻辑 // 开发者自行实现业务逻辑
console.log(TAG, `insertDataToMap, key: ${key} val: ${val}`); console.info(TAG, `insertDataToMap, key: ${key} val: ${val}`);
callback(ERR_OK); callback(ERR_OK);
} }
} }
...@@ -320,10 +320,10 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap ...@@ -320,10 +320,10 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap
let serviceExtProxy = new IdlServiceExtProxy(remote); let serviceExtProxy = new IdlServiceExtProxy(remote);
// 通过接口调用的方式进行通信,屏蔽了RPC通信的细节,简洁明了 // 通过接口调用的方式进行通信,屏蔽了RPC通信的细节,简洁明了
serviceExtProxy.processData(1, (errorCode, retVal) => { serviceExtProxy.processData(1, (errorCode, retVal) => {
console.log(`processData, errorCode: ${errorCode}, retVal: ${retVal}`); console.info(`processData, errorCode: ${errorCode}, retVal: ${retVal}`);
}); });
serviceExtProxy.insertDataToMap('theKey', 1, (errorCode) => { serviceExtProxy.insertDataToMap('theKey', 1, (errorCode) => {
console.log(`insertDataToMap, errorCode: ${errorCode}`); console.info(`insertDataToMap, errorCode: ${errorCode}`);
}) })
}, },
onDisconnect(elementName) { onDisconnect(elementName) {
...@@ -415,7 +415,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap ...@@ -415,7 +415,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap
insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void { insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void {
// 开发者自行实现业务逻辑 // 开发者自行实现业务逻辑
console.log(TAG, `insertDataToMap, key: ${key} val: ${val}`); console.info(TAG, `insertDataToMap, key: ${key} val: ${val}`);
callback(ERR_OK); callback(ERR_OK);
} }
} }
...@@ -455,7 +455,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap ...@@ -455,7 +455,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap
insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void { insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void {
// 开发者自行实现业务逻辑 // 开发者自行实现业务逻辑
console.log(TAG, `insertDataToMap, key: ${key} val: ${val}`); console.info(TAG, `insertDataToMap, key: ${key} val: ${val}`);
callback(ERR_OK); callback(ERR_OK);
} }
} }
......
...@@ -43,7 +43,7 @@ WindowExtensionAbility提供了onConnect()、onDisconnect()和onWindowReady()生 ...@@ -43,7 +43,7 @@ WindowExtensionAbility提供了onConnect()、onDisconnect()和onWindowReady()生
onWindowReady(window) { onWindowReady(window) {
window.loadContent('WindowExtAbility/pages/index1').then(() => { window.loadContent('WindowExtAbility/pages/index1').then(() => {
window.getProperties().then((pro) => { window.getProperties().then((pro) => {
console.log("WindowExtension " + JSON.stringify(pro)); console.info("WindowExtension " + JSON.stringify(pro));
}) })
window.show(); window.show();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册