Appendix log for ttrace
[platform/core/uifw/dali-adaptor.git] / dali / internal / trace / tizen / trace-manager-impl-tizen.cpp
index 956653f..0d2b2bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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,6 +34,7 @@ namespace Adaptor
 namespace
 {
 const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
+const char* EMPTY_TAG                       = "(null)";
 static bool gTraceManagerEnablePrintLog     = false;
 
 } // namespace
@@ -53,15 +54,15 @@ Dali::Integration::Trace::LogContextFunction TraceManagerTizen::GetLogContextFun
   return LogContext;
 }
 
-void TraceManagerTizen::LogContext(bool start, const char* tag)
+void TraceManagerTizen::LogContext(bool start, const char* tag, const char* message)
 {
   if(start)
   {
-    traceBegin(TTRACE_TAG_GRAPHICS, tag);
+    traceBegin(TTRACE_TAG_GRAPHICS, tag ? tag : EMPTY_TAG);
 
     if(gTraceManagerEnablePrintLog)
     {
-      DALI_LOG_DEBUG_INFO("BEGIN: %s\n", tag);
+      DALI_LOG_DEBUG_INFO("BEGIN: %s%s%s\n", tag ? tag : EMPTY_TAG, message ? " " : "", message ? message : "");
     }
   }
   else
@@ -70,7 +71,7 @@ void TraceManagerTizen::LogContext(bool start, const char* tag)
 
     if(gTraceManagerEnablePrintLog)
     {
-      DALI_LOG_DEBUG_INFO("END: %s\n", tag);
+      DALI_LOG_DEBUG_INFO("END: %s%s%s\n", tag ? tag : EMPTY_TAG, message ? " " : "", message ? message : "");
     }
   }
 }