修改日志打印,受WEARABLE_LOG_DEBUG宏控制
authorSnickerSun <snickersun@163.com>
Thu, 14 Dec 2023 11:50:34 +0000 (19:50 +0800)
committerSnickerSun <snickersun@163.com>
Thu, 14 Dec 2023 11:50:34 +0000 (19:50 +0800)
14 files changed:
code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp
code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/compass/src/MainCompassPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/connectnewphone/src/ConnectPhonePresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp
code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempPresenter.cpp
code/sdk/application/wearable/ohos_deps/wearable_log.h

index e0e1574..091024a 100755 (executable)
@@ -445,7 +445,7 @@ bool AlarmPresenter::OnClick(UIView &view, const ClickEvent &event)
 bool AlarmPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
 {
     uint16 keyID = event.GetKeyId();
-    printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
     //如果是power键就返回上一级
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index 7afe988..3fcb8d1 100755 (executable)
@@ -455,7 +455,7 @@ bool MainAlarmView::ChangeMaxClock(int16_t thisView)
 
 void MainAlarmView::DropView(UIView& view)
 {
-    printf("into DropView!\n");
+    WEARABLE_LOGD("","into DropView!\n");
     
     if (&view == container[CHANGE_INTERFACE_CONFIG]) {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView::DropView::container[CHANGE_INTERFACE_CONFIG]");
index fc125f0..dc519e1 100755 (executable)
@@ -99,9 +99,9 @@ bool BloodOxygenPresenter::OnClick(UIView& view, const ClickEvent& event)
 //增加按键事件
 bool BloodOxygenPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
 {
-    printf("into the view is: %s\n", typeid(view).name());
+    WEARABLE_LOGD("","into the view is: %s\n", typeid(view).name());
     uint16 keyID = event.GetKeyId();
-    printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
     //如果是power键就返回上一级
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index 243b705..7cd3fc9 100755 (executable)
@@ -221,7 +221,7 @@ bool BluetoothPresenter::OnClick(UIView &view, const ClickEvent &event)
        bool BluetoothPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
        {
                uint16 keyID = event.GetKeyId();
-               printf("into key!\n");
+        WEARABLE_LOGD("","into key! keyID %u\n",keyID);
        #if 0
                //如果是power键就返回上一级
                if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index bc83d83..cc0a911 100755 (executable)
@@ -7,6 +7,7 @@
 #include "CompassView.h"
 #include "MainCompassPresenter.h"
 #include "MainCompassView.h"
+#include "wearable_log.h"
 
 namespace OHOS {
 static MainCompassPresenter *g_pMainView = nullptr;
@@ -50,7 +51,7 @@ bool MainCompassPresenter::OnDrag(UIView& view, const DragEvent& event)
 bool MainCompassPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
 {
     uint16 keyID = event.GetKeyId();
-    printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
     //如果是power键就返回上一级
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index 46e9fe9..6366261 100755 (executable)
@@ -133,7 +133,7 @@ bool ConnectPhonePresenter::OnDrag(UIView& view, const DragEvent& event)
 bool ConnectPhonePresenter::OnKeyAct(UIView& view, const KeyEvent& event)
 {
     uint16 keyID = event.GetKeyId();
-    printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
     //如果是power键就返回上一级
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index a3eedab..24d3e25 100755 (executable)
@@ -277,7 +277,7 @@ bool IndoorWalkPresenter::OnDrag(UIView& view, const DragEvent& event)
 bool IndoorWalkPresenter::OnKeyAct(UIView &view, const KeyEvent &event)
 {
        uint16 keyID = event.GetKeyId();
-       printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
                //如果是power键就返回上一级
                if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index 61730b7..ff5b059 100755 (executable)
@@ -279,7 +279,7 @@ void PullUpDownView::InitViewInfo(void)
 
 bool PullUpDownView::InitView()
 {
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::InitDropDownView caller:%p", caller);
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::InitDropDownView \n");
     clickListener = (UIView::OnClickListener *)OHOS::MainPresenterSample::GetInstance();
 
     InitViewImg();
index 4704df4..83d7edc 100755 (executable)
@@ -128,7 +128,7 @@ bool VocassistPresenter::OnDrag(UIView& view, const DragEvent& event)
 bool VocassistPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
 {
     uint16 keyID = event.GetKeyId();
-    printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
     //如果是power键就返回上一级
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index ee7e942..052695d 100755 (executable)
@@ -550,9 +550,9 @@ static void CatBdAddr(const bd_addr_t *bdAddr)
 {
 #if WEARABLEOG_DEBUG_ENABLE
     for (unsigned char i = 0; i < BD_ADDR_LEN; i++) {
-        printf("%X", bdAddr->addr[i]);
+        WEARABLE_LOGD("","%X", bdAddr->addr[i]);
     }
-    printf("");
+    WEARABLE_LOGD("","");
 #else
     UNUSED(bdAddr);
 #endif
@@ -1011,9 +1011,9 @@ static void CatPhoneNumber(char *number, unsigned char len)
 {
 #if WEARABLEOG_DEBUG_ENABLE
     for (unsigned char i = 0; i < len; i++) {
-        printf("%c", *(number + i));
+        WEARABLE_LOGD("","%c", *(number + i));
     }
-    printf("");
+    WEARABLE_LOGD("","");
 #else
     UNUSED(number);
     UNUSED(len);
index 2ad0889..c240f6e 100755 (executable)
@@ -930,9 +930,9 @@ void PlayerOnDragListener::OnDragChangView(const DragEvent& event, int16_t hideV
 //增加按键事件
 bool  PlayerOnDragListener::OnKeyAct(UIView& view, const KeyEvent& event)
 {
-        printf("into the view is: %s\n", typeid(view).name());
+        WEARABLE_LOGD("","into the view is: %s\n", typeid(view).name());
         uint16 keyID = event.GetKeyId();
-               printf("into key!\n");
+        WEARABLE_LOGD("","into key! keyID %u\n",keyID);
        #if 0
                //如果是power键就返回上一级
                if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index e4a932f..78ca04f 100755 (executable)
@@ -60,7 +60,7 @@ namespace OHOS {
        bool SettingPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
        {
                uint16 keyID = event.GetKeyId();
-               printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
        #if 0
                //如果是power键就返回上一级
                if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index 04850ba..376f9c9 100755 (executable)
@@ -70,7 +70,7 @@ bool TempPresenter::OnDrag(UIView& view, const DragEvent& event)
 bool TempPresenter::OnKeyAct(UIView& view, const KeyEvent& event)
 {
     uint16 keyID = event.GetKeyId();
-    printf("into key!\n");
+    WEARABLE_LOGD("","into key! keyID %u\n",keyID);
 #if 0
     //如果是power键就返回上一级
     if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER))
index 5737633..47b6fd0 100755 (executable)
@@ -12,7 +12,7 @@
 extern "C" {
 #endif
 #endif
-
+// #define WEARABLE_LOG_DEBUG
 #ifdef USE_DIAG_LOG
 #include "soc_diag_util.h"
 #include "log_oam_logger.h"