Change DebugPriority name and Debug priority 11/285611/4
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 15 Dec 2022 09:09:41 +0000 (18:09 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 19 Dec 2022 00:12:27 +0000 (09:12 +0900)
Change-Id: I01dc0b22802a66b51d4ad3fb338b270c7d810142

automated-tests/src/dali-internal/utc-Dali-Internal-TransformManagerProperty.cpp
automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
dali/integration-api/debug.cpp
dali/integration-api/debug.h
dali/internal/event/common/thread-local-storage.cpp
dali/internal/render/common/render-debug.cpp

index 18daa36..0b6a440 100644 (file)
 
 // Internal headers are allowed here
 
+namespace
+{
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Verbose, true, "LOG_UTC_TRANSFORM_MANAGER_PROPERTY");
+#endif
+} // namespace
+
 void utc_dali_internal_transform_manager_property_startup()
 {
   test_return_value = TET_UNDEF;
@@ -36,6 +43,9 @@ int UtcTransformManagerPropertyGetFloatComponentN(void)
 {
   TestApplication application;
 
+  // For coverage
+  DALI_LOG_TRACE_METHOD(gLogFilter);
+
   struct S
   {
     Dali::Internal::SceneGraph::TransformManagerData                                  txMgrData;
@@ -52,6 +62,9 @@ int UtcTransformManagerPropertyGetFloatComponentN(void)
     DALI_TEST_ASSERT(e, "0 && \"Invalid call\"", TEST_LOCATION);
   }
 
+  // For coverage
+  DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Test End\n");
+
   END_TEST;
 }
 
index 873b7b3..e4c6078 100644 (file)
@@ -117,13 +117,16 @@ void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, st
   {
     switch(level)
     {
-      case Dali::Integration::Log::DebugInfo:
+      case Dali::Integration::Log::DEBUG:
+        fprintf(stderr, "DEBUG: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::INFO:
         fprintf(stderr, "INFO: %s", message.c_str());
         break;
-      case Dali::Integration::Log::DebugWarning:
+      case Dali::Integration::Log::WARNING:
         fprintf(stderr, "WARN: %s", message.c_str());
         break;
-      case Dali::Integration::Log::DebugError:
+      case Dali::Integration::Log::ERROR:
         fprintf(stderr, "ERROR: %s", message.c_str());
         break;
       default:
index ebbc339..858b4d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -166,14 +166,14 @@ void Filter::Log(LogLevel level, const char* format, ...)
       if(numChars >= 0) // No error
       {
         std::string message = ArgListToString(buffer, arg);
-        LogMessage(DebugInfo, message.c_str());
+        LogMessage(INFO, message.c_str());
         free(buffer);
       }
     }
     else
     {
       std::string message = ArgListToString(format, arg);
-      LogMessage(DebugInfo, message.c_str());
+      LogMessage(INFO, message.c_str());
     }
     va_end(arg);
   }
@@ -189,7 +189,7 @@ TraceObj::TraceObj(Filter* filter, const char* format, ...)
     mMessage = ArgListToString(format, arg);
     va_end(arg);
 
-    LogMessage(DebugInfo, "Entr%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str());
+    LogMessage(INFO, "Entr%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str());
     ++mFilter->mNesting;
   }
 }
@@ -202,7 +202,7 @@ TraceObj::~TraceObj()
     {
       --mFilter->mNesting;
     }
-    LogMessage(DebugInfo, "Exit%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str());
+    LogMessage(INFO, "Exit%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str());
   }
 }
 
index 7daa433..8533270 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_DEBUG_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // EXTERNAL INCLUDES
 #include <stdint.h>
+#include <cstring>
 #include <iostream>
 #include <list>
 #include <sstream>
 #include <string>
-#include <cstring>
 
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/property-map.h>
@@ -79,9 +79,10 @@ namespace Log
 {
 enum DebugPriority
 {
-  DebugInfo,
-  DebugWarning,
-  DebugError
+  DEBUG,
+  INFO,
+  WARNING,
+  ERROR
 };
 
 /**
@@ -100,7 +101,7 @@ DALI_CORE_API void LogMessage(enum DebugPriority level, const char* format, ...)
 #define __MODULE__ (std::strrchr(__FILE__, '/') ? std::strrchr(__FILE__, '/') + 1 : __FILE__)
 #endif
 #define DALI_LOG_FORMAT_PREFIX "%s: %s(%d) > "
-#define DALI_LOG_FORMAT_PREFIX_ARGS __MODULE__,__func__,__LINE__
+#define DALI_LOG_FORMAT_PREFIX_ARGS __MODULE__, __func__, __LINE__
 #endif
 
 /**
@@ -108,11 +109,11 @@ DALI_CORE_API void LogMessage(enum DebugPriority level, const char* format, ...)
  * @param level debug level
  * @param format string format
  */
-#define LogMessageWithFunctionLine(level, format, ...)                 \
-  LogMessage(level,                                                    \
-  (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \
-  DALI_LOG_FORMAT_PREFIX_ARGS,                                         \
-  ##__VA_ARGS__)
+#define LogMessageWithFunctionLine(level, format, ...)                            \
+  LogMessage(level,                                                               \
+             (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \
+             DALI_LOG_FORMAT_PREFIX_ARGS,                                         \
+             ##__VA_ARGS__)
 
 /**
  * typedef for the logging function.
@@ -141,38 +142,43 @@ DALI_CORE_API void UninstallLogFunction();
 /**
  * Provides unfiltered logging for global error level messages
  */
-#define DALI_LOG_ERROR(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugError, format, ##__VA_ARGS__)
+#define DALI_LOG_ERROR(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::ERROR, format, ##__VA_ARGS__)
 
-#define DALI_LOG_ERROR_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ##__VA_ARGS__)
+#define DALI_LOG_ERROR_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::ERROR, format, ##__VA_ARGS__)
 
-#define DALI_LOG_WARNING_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ##__VA_ARGS__)
+#define DALI_LOG_WARNING_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::WARNING, format, ##__VA_ARGS__)
 
 /**
  * Provides unfiltered logging for fps monitor
  */
-#define DALI_LOG_FPS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__)
+#define DALI_LOG_FPS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, format, ##__VA_ARGS__)
 
 /**
  * Provides unfiltered logging for update status
  */
-#define DALI_LOG_UPDATE_STATUS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__)
+#define DALI_LOG_UPDATE_STATUS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, format, ##__VA_ARGS__)
 
 /**
  * Provides unfiltered logging for render information
  */
-#define DALI_LOG_RENDER_INFO(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__)
+#define DALI_LOG_RENDER_INFO(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, format, ##__VA_ARGS__)
 
 /**
  * Provides unfiltered logging for release
  */
-#define DALI_LOG_RELEASE_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__)
+#define DALI_LOG_RELEASE_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::INFO, format, ##__VA_ARGS__)
+
+/**
+ * Provides unfiltered logging for debuf information
+ */
+#define DALI_LOG_DEBUG_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DEBUG, format, ##__VA_ARGS__)
 
 #ifdef DEBUG_ENABLED
 
 /**
  * Provides unfiltered logging for global warning level messages
  */
-#define DALI_LOG_WARNING(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugWarning, "%s " format, ASSERT_LOCATION, ##__VA_ARGS__)
+#define DALI_LOG_WARNING(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::WARNING, "%s " format, ASSERT_LOCATION, ##__VA_ARGS__)
 
 #else // DEBUG_ENABLED
 
@@ -363,13 +369,13 @@ public:
 
 #ifdef DEBUG_ENABLED
 
-#define DALI_LOG_INFO(filter, level, format, ...)                        \
-  if(filter && filter->IsEnabledFor(level))                              \
-  {                                                                      \
-    filter->Log(level,                                                   \
-    (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \
-    DALI_LOG_FORMAT_PREFIX_ARGS,                                         \
-    ##__VA_ARGS__);                                                      \
+#define DALI_LOG_INFO(filter, level, format, ...)                                    \
+  if(filter && filter->IsEnabledFor(level))                                          \
+  {                                                                                  \
+    filter->Log(level,                                                               \
+                (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \
+                DALI_LOG_FORMAT_PREFIX_ARGS,                                         \
+                ##__VA_ARGS__);                                                      \
   }
 
 #define DALI_LOG_STREAM(filter, level, stream) \
@@ -393,7 +399,7 @@ public:
 
 /*
  * These macros allow the instrumentation of methods. These translate into calls
- * to LogMessage(DebugInfo).
+ * to LogMessage(INFO).
  */
 
 #ifdef DEBUG_ENABLED
index aca21f4..6ebfc68 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ Debug::Filter* gSingletonServiceLogFilter = Debug::Filter::New(Debug::NoLogging,
   if(gSingletonServiceLogFilter && gSingletonServiceLogFilter->IsEnabledFor(level)) \
   {                                                                                 \
     std::string string(message);                                                    \
-    Dali::TizenPlatform::LogMessage(Debug::DebugInfo, string);                      \
+    Dali::TizenPlatform::LogMessage(Debug::INFO, string);                           \
   }
 
 #define DALI_LOG_SINGLETON_SERVICE(level, format, ...) DALI_LOG_INFO(gSingletonServiceLogFilter, level, format, ##__VA_ARGS__)
index d4080e5..aa463ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -99,7 +99,7 @@ void PrintRendererCount(unsigned int frameCount, unsigned int rendererCount)
 {
   if(frameCount % 120 == 30) // Print every 2 seconds reg
   {
-    Debug::LogMessage(Debug::DebugInfo, "Renderer Total # renderers: %u\n", rendererCount);
+    Debug::LogMessage(Debug::INFO, "Renderer Total # renderers: %u\n", rendererCount);
   }
 }