Support 'enable_debug' feature 79/277679/1
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 12 Jul 2022 05:31:33 +0000 (14:31 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Tue, 12 Jul 2022 05:32:24 +0000 (14:32 +0900)
Change-Id: Ib031c71a27c556e26d626d4018688552dddb5c69

build/tizen/CMakeLists.txt
packaging/widget-viewer-dali.spec
widget_viewer_dali/internal/widget_view/widget_view_impl.cpp

index c8a1457d72bb0e93d6066163cfa20d70caf597e3..673ca2d86c367c08fe4e4b99a54c29381e45ff96 100644 (file)
@@ -78,6 +78,18 @@ ADD_DEFINITIONS("-DWIDGET_VIEW_RESOURCE_DEFAULT_IMG=\"${IMAGE_DIR}/unknown.png\"
 ADD_DEFINITIONS("-DWIDGET_VIEWER_DALI_LOCALE=\"${LOCALE_DIR}\"")
 ADD_DEFINITIONS("-DPKGNAME=\"${PROJECT_NAME}\"")
 
+IF(CMAKE_BUILD_TYPE MATCHES Debug)
+  SET( ENABLE_DEBUG ON )
+ENDIF()
+
+IF( ENABLE_DEBUG )
+  MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Debug )
+  ADD_DEFINITIONS( "-DDEBUG_ENABLED" )
+  SET( ENABLE_EXPORTALL ON )
+ELSE()
+  MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Release )
+ENDIF()
+
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${ROOT_SRC_DIR})
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE})
index 9c3b7c997aa1eb81b91773dcd93fae5d890b549d..1d57dab880ff7f7e4fb834c2e73feaf4ef8708db 100644 (file)
@@ -83,6 +83,9 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
        -DENABLE_ECOREWL2=%{ENABLE_ECOREWL2} \
        -DFULLVER=%{version} \
        -DMAJORVER=${MAJORVER} \
+%if 0%{?enable_debug}
+      -DCMAKE_BUILD_TYPE=Debug \
+%endif
        .
 
 make %{?jobs:-j%jobs}
index 1fae55ff06b1b42a277c5d46012b5ca245db11d3..b5a2f9511df6bd3aff8332509e32e3b0b9aef8df 100644 (file)
@@ -306,7 +306,7 @@ bool WidgetView::PauseWidgetInternally()
      return false;
   }
 
-  DALI_LOG_RELEASE_INFO("WidgetView::PauseWidget: Widget is paused (%s, %s)\n", mWidgetId.c_str(), mInstanceId.c_str() );
+  DALI_LOG_RELEASE_INFO("WidgetView::PauseWidget: Widget is paused (%s, %s) [%p]\n", mWidgetId.c_str(), mInstanceId.c_str(), this );
 
   return true;
 }
@@ -330,7 +330,7 @@ bool WidgetView::ResumeWidgetInternally()
      return false;
   }
 
-  DALI_LOG_RELEASE_INFO("WidgetView::ResumeWidget: Widget is resumed (%s, %s)\n", mWidgetId.c_str(), mInstanceId.c_str() );
+  DALI_LOG_RELEASE_INFO("WidgetView::ResumeWidget: Widget is resumed (%s, %s) [%p]\n", mWidgetId.c_str(), mInstanceId.c_str(), this );
 
   return true;
 }
@@ -416,7 +416,7 @@ const std::string& WidgetView::GetTitle()
     mTitle = widget_service_get_name( mWidgetId.c_str(), NULL );
   }
 
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::GetTitle: title = %s\n", mTitle.c_str() );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::GetTitle: title = %s [%p]\n", mTitle.c_str(), this );
 
   return mTitle;
 }
@@ -542,7 +542,7 @@ void WidgetView::CreateWidgetRenderer()
   Dali::WidgetView::WidgetView handle( GetOwner() );
   mWidgetAddedSignal.Emit( handle );
 
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::CreateWidgetRenderer: Widget image is added.\n" );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::CreateWidgetRenderer: Widget image is added. [%p]\n", this );
 }
 
 void WidgetView::RemoveWidgetRenderer()
@@ -557,12 +557,12 @@ void WidgetView::RemoveWidgetRenderer()
     mWidgetDeletedSignal.Emit( handle );
   }
 
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::RemoveWidgetRenderer: Widget image is removed.\n" );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::RemoveWidgetRenderer: Widget image is removed. [%p]\n", this );
 }
 
 bool WidgetView::TerminateWidget()
 {
-  DALI_LOG_WARNING("TerminateWidget() will be depreceated. Please use RemoveWidget() in WidgetViewManager instead.\n");
+  DALI_LOG_WARNING("TerminateWidget() will be depreceated. Please use RemoveWidget() in WidgetViewManager instead. [%p]\n", this);
   return RemoveWidget();
 }
 
@@ -608,7 +608,7 @@ bool WidgetView::RemoveWidget()
     return ( (ret < 0)? false : true );
   }
 
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::TerminateWidget: Widget is terminated/destroyed and deleted signal is emitted.\n" );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::TerminateWidget: Widget is terminated/destroyed and deleted signal is emitted. [%p]\n", this );
 
   return false;
 }
@@ -617,7 +617,7 @@ void WidgetView::SendWidgetEvent( int event )
 {
   Dali::WidgetView::WidgetView handle( GetOwner() );
 
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::SendWidgetEvent: event = %d widget = %s\n", event,  mWidgetId.c_str() );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::SendWidgetEvent: event = %d widget = %s [%p]\n", event,  mWidgetId.c_str(), this );
 
   // Emit signal
   switch( event )
@@ -955,8 +955,8 @@ void WidgetView::OnInitialize()
     return;
   }
 
-  DALI_LOG_RELEASE_INFO("WidgetView::OnInitialize: widget_instance_create is called. [widget id = %s, instance id = %s]\n",
-                 mWidgetId.c_str(), instanceId );
+  DALI_LOG_RELEASE_INFO("WidgetView::OnInitialize: widget_instance_create is called. [widget id = %s, instance id = %s] [%p]\n",
+                 mWidgetId.c_str(), instanceId, this );
 
   mInstanceId = instanceId;
 
@@ -992,7 +992,7 @@ void WidgetView::OnInitialize()
     previewImage = WIDGET_VIEW_RESOURCE_DEFAULT_IMG;
   }
 
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnInitialize: preview image path = %s\n", previewImage.c_str() );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnInitialize: preview image path = %s [%p]\n", previewImage.c_str(), this );
 
 
   mPreviewActor = Dali::Actor::New();
@@ -1096,7 +1096,7 @@ void WidgetView::OnWindowVisibilityChanged( Window window, bool visible )
   if( mPausedManually )
   {
     mPaused = ( needPaused || !mWindowVisible );
-    DALI_LOG_RELEASE_INFO("Do not resume widget, because widget is paued manually \n");
+    DALI_LOG_RELEASE_INFO("Do not resume widget, because widget is paued manually [%p]\n", this);
     return;
   }
 
@@ -1108,14 +1108,14 @@ void WidgetView::OnWindowVisibilityChanged( Window window, bool visible )
   {
     PauseWidgetInternally();
   }
-  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnWindowVisibilityChanged: visibility is changed (visible: %d)\n", visible );
+  DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::OnWindowVisibilityChanged: visibility is changed (visible: %d) [%p]\n", visible, this );
 }
 
 void WidgetView::OnUpdateArea( Dali::PropertyNotification& source )
 {
   if(!mCreated)
   {
-    DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "Do not pause/resume widget, because widget is not created \n");
+    DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "Do not pause/resume widget, because widget is not created [%p]\n", this);
     return;
   }
 
@@ -1123,7 +1123,7 @@ void WidgetView::OnUpdateArea( Dali::PropertyNotification& source )
   if( mPausedManually )
   {
     mPaused = needPaused;
-    DALI_LOG_RELEASE_INFO("Do not resume widget, because widget is paued manually \n");
+    DALI_LOG_RELEASE_INFO("Do not resume widget, because widget is paued manually [%p]\n", this);
     return;
   }
 
@@ -1248,7 +1248,7 @@ bool WidgetView::OnKeyEvent( const Dali::KeyEvent& event )
                                            static_cast< uint32_t >( event.GetTime() ),
                                            &consumed);
 
-  DALI_LOG_RELEASE_INFO("Sync keyEvent Send, type:%d keyCode :%d, name:%s , consumed(%d) \n", type, event.GetKeyCode(), event.GetKeyName().c_str(), consumed);
+  DALI_LOG_RELEASE_INFO("Sync keyEvent Send, type:%d keyCode :%d, name:%s , consumed(%d) [%p]\n", type, event.GetKeyCode(), event.GetKeyName().c_str(), consumed, this);
 
   return consumed;
 
@@ -1724,7 +1724,7 @@ bool WidgetView::LaunchWidget()
     // Emit signal
     Dali::WidgetView::WidgetView handle( GetOwner() );
     mWidgetCreationAbortedSignal.Emit( handle );
-    DALI_LOG_RELEASE_INFO("WidgetView::LaunchWidget: widget_instance_launch is failed. [%s]\n", mWidgetId.c_str() );
+    DALI_LOG_RELEASE_INFO("WidgetView::LaunchWidget: widget_instance_launch is failed. [%s] [%p]\n", mWidgetId.c_str(), this );
     return false;
   }
   return true;