From 1895d50b1a4867ad8e3be4bbaf13768465efe6bc Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Thu, 21 Oct 2021 22:39:23 +0900 Subject: [PATCH] Fix LogMessage format to print Filename / Functioname / Line Add LogMessageDlogFormat macro to apply these informations : Filename: Function(Line#) > "messages" Previous LogMessage function always print like this logging-tizen.cpp: LogMessage(38) > "messages" So we fix to print actual informations Default LogMessage(~~) will be used when someone don't need to follow up Dlog format. (like ttrace and perfomance logger) Change-Id: Ifa77b921bcb189165114c5b1e08a18175abd939d Signed-off-by: Eunki, Hong --- automated-tests/src/dali-scene-loader/utc-Dali-StringCallback.cpp | 2 +- dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp | 2 +- .../internal/controls/scrollable/scroll-view/scroll-view-impl.cpp | 2 +- dali-toolkit/internal/controls/table-view/table-view-impl.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automated-tests/src/dali-scene-loader/utc-Dali-StringCallback.cpp b/automated-tests/src/dali-scene-loader/utc-Dali-StringCallback.cpp index acd5183..113f40a 100644 --- a/automated-tests/src/dali-scene-loader/utc-Dali-StringCallback.cpp +++ b/automated-tests/src/dali-scene-loader/utc-Dali-StringCallback.cpp @@ -41,6 +41,6 @@ int UtcDaliUtilsDefaultStringCallback(void) { InstallLogFunction(TestLogFunction); DefaultErrorCallback("Hello world!"); - DALI_TEST_EQUAL(std::string(sBuffer), "2: DefaultErrorCallback Hello world!"); + DALI_TEST_EQUAL(std::string(sBuffer), "2: string-callback.cpp: DefaultErrorCallback(26) > Hello world!"); END_TEST; } diff --git a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp index a3c092d..4a3b065 100644 --- a/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp +++ b/dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp @@ -39,7 +39,7 @@ namespace // currently not called from code so compiler will optimize these away, kept here for future debugging #define FLEX_CONTAINER_TAG "DALI Toolkit::FlexContainer " -#define FC_LOG(fmt, args, ...) Debug::LogMessage(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ##args) +#define FC_LOG(fmt, args, ...) Debug::LogMessageWithFunctionLine(Debug::DebugInfo, FLEX_CONTAINER_TAG fmt, ##args) // #define FLEX_CONTAINER_DEBUG 1 #if defined(FLEX_CONTAINER_DEBUG) diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index fa65e95..86cfc56 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -43,7 +43,7 @@ //#define ENABLED_SCROLL_STATE_LOGGING #ifdef ENABLED_SCROLL_STATE_LOGGING -#define DALI_LOG_SCROLL_STATE(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, "%s:%d " format "\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) +#define DALI_LOG_SCROLL_STATE(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugInfo, "%s:%d " format "\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) #else #define DALI_LOG_SCROLL_STATE(format, ...) #endif diff --git a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp index 4b3e019..9aec5ba 100644 --- a/dali-toolkit/internal/controls/table-view/table-view-impl.cpp +++ b/dali-toolkit/internal/controls/table-view/table-view-impl.cpp @@ -51,7 +51,7 @@ bool FitToChild(Actor actor, Dimension::Type dimension) // currently not called from code so compiler will optimize these away, kept here for future debugging #define TABLEVIEW_TAG "DALI Toolkit::TableView " -#define TV_LOG(fmt, args, ...) Debug::LogMessage(Debug::DebugInfo, TABLEVIEW_TAG fmt, ##args) +#define TV_LOG(fmt, args, ...) Debug::LogMessageWithFunctionLine(Debug::DebugInfo, TABLEVIEW_TAG fmt, ##args) //#define TABLEVIEW_DEBUG 1 #if defined(TABLEVIEW_DEBUG) -- 2.7.4