@onekeyfe/hd-ble-sdk
Advanced tools
Comparing version 0.1.14 to 0.1.16
@@ -516,3 +516,3 @@ 'use strict'; | ||
const eventEmitter = new events.exports(); | ||
const Log = HardwareSdk.initLog('@onekey/hd-ble-sdk'); | ||
const Log = HardwareSdk.getLogger(HardwareSdk.LoggerNames.HdBleSdk); | ||
let _core; | ||
@@ -543,3 +543,5 @@ let _settings = HardwareSdk.parseConnectSettings(); | ||
} | ||
Log.debug('hd-ble-sdk handleMessage', message); | ||
if (event !== HardwareSdk.LOG_EVENT) { | ||
Log.debug('hd-ble-sdk handleMessage', message); | ||
} | ||
switch (event) { | ||
@@ -550,2 +552,5 @@ case HardwareSdk.UI_EVENT: | ||
break; | ||
case HardwareSdk.LOG_EVENT: | ||
eventEmitter.emit(message.event, message); | ||
break; | ||
default: | ||
@@ -576,2 +581,3 @@ Log.log('No need to be captured message', message.event); | ||
_core === null || _core === void 0 ? void 0 : _core.on(HardwareSdk.CORE_EVENT, handleMessage); | ||
HardwareSdk.setLoggerPostMessage(handleMessage); | ||
return true; | ||
@@ -578,0 +584,0 @@ } |
{ | ||
"name": "@onekeyfe/hd-ble-sdk", | ||
"version": "0.1.14", | ||
"version": "0.1.16", | ||
"author": "OneKey", | ||
@@ -23,7 +23,7 @@ "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", | ||
"dependencies": { | ||
"@onekeyfe/hd-core": "^0.1.14", | ||
"@onekeyfe/hd-shared": "^0.1.14", | ||
"@onekeyfe/hd-transport-react-native": "^0.1.14" | ||
"@onekeyfe/hd-core": "^0.1.16", | ||
"@onekeyfe/hd-shared": "^0.1.16", | ||
"@onekeyfe/hd-transport-react-native": "^0.1.16" | ||
}, | ||
"gitHead": "216fee1795067013da0d68f4fc25f583509bb509" | ||
"gitHead": "e87fdbab30d6daa4f32e28259bd221d75b5d6aad" | ||
} |
@@ -5,3 +5,2 @@ import EventEmitter from 'events'; | ||
enableLog, | ||
initLog, | ||
parseConnectSettings, | ||
@@ -18,2 +17,6 @@ initCore, | ||
UI_REQUEST, | ||
LOG_EVENT, | ||
getLogger, | ||
LoggerNames, | ||
setLoggerPostMessage, | ||
} from '@onekeyfe/hd-core'; | ||
@@ -24,3 +27,3 @@ import { ERRORS, createDeferred, Deferred, HardwareErrorCode } from '@onekeyfe/hd-shared'; | ||
const eventEmitter = new EventEmitter(); | ||
const Log = initLog('@onekey/hd-ble-sdk'); | ||
const Log = getLogger(LoggerNames.HdBleSdk); | ||
@@ -56,4 +59,6 @@ let _core: Core | undefined; | ||
} | ||
Log.debug('hd-ble-sdk handleMessage', message); | ||
if (event !== LOG_EVENT) { | ||
Log.debug('hd-ble-sdk handleMessage', message); | ||
} | ||
switch (event) { | ||
@@ -65,2 +70,5 @@ case UI_EVENT: | ||
break; | ||
case LOG_EVENT: | ||
eventEmitter.emit(message.event, message); | ||
break; | ||
default: | ||
@@ -92,2 +100,3 @@ Log.log('No need to be captured message', message.event); | ||
enableLog(!!settings.debug); | ||
Log.debug('init'); | ||
@@ -98,2 +107,3 @@ | ||
_core?.on(CORE_EVENT, handleMessage); | ||
setLoggerPostMessage(handleMessage); | ||
@@ -100,0 +110,0 @@ return true; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25307
673