The LogTracer class is added for debugging.
Change-Id: Ie4e12787ff5a7a3e60b5b9b054c70dea996b6a37
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
#include "app-core-cpp/sigterm_handler_private.hh"
#include "common/glib_private.hh"
#include "common/log_private.hh"
+#include "common/log_tracer.hh"
extern "C" void aul_finalize();
namespace tizen_cpp {
}
void AppCoreBase::Init(int argc, char** argv) {
+ LogTracer tracer("AppCoreBase::Init()");
impl_->tid_ = 0;
impl_->suspended_state_ = false;
impl_->allowed_bg_ = false;
}
void AppCoreBase::Fini() {
+ LogTracer tracer("AppCoreBase::Fini()");
if (impl_->signal_handler_source_) {
g_source_remove(impl_->signal_handler_source_);
impl_->signal_handler_source_ = 0;
#include "app-core-efl-cpp/app_core_efl_base.hh"
#include "app-core-efl-cpp/voice_elm_private.hh"
-#include "common/log_private.hh"
#include "common/glib_private.hh"
+#include "common/log_private.hh"
+#include "common/log_tracer.hh"
namespace tizen_cpp {
}
void AppCoreEflBase::Impl::Init(int argc, char** argv) {
+ LogTracer tracer("AppCoreEflBase::Impl::Init()");
if (initialized_)
return;
}
void AppCoreEflBase::Impl::Finish() {
+ LogTracer tracer("AppCoreEflBase::Impl::Finish()");
if (!initialized_)
return;
#include "common/ecore_handler.hh"
#include "common/glib_private.hh"
#include "common/log_private.hh"
+#include "common/log_tracer.hh"
namespace tizen_cpp {
constexpr const char K_SERVICE_THREAD[] = "__K_SERVICE_THREAD";
constexpr const char K_HINT_RECENT_SCREEN_POSITION[] =
"__K_HINT_RECENT_SCREEN_POSITION";
+const int APPID_MAX = 256;
class AppCoreUiBase::Impl {
public:
}
void AppCoreUiBase::Impl::PluginInit(int argc, char** argv) {
+ LogTracer tracer("AppCoreUiBase::Impl::PluginInit()");
plugin_.reset(AppCoreUiPlugin::Load());
if (plugin_ == nullptr)
return;
impl_->handler_->Init();
impl_->PluginInit(argc, argv);
- char appid[PATH_MAX] = {0, };
+ char appid[APPID_MAX] = {0, };
int ret = aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
if (ret != 0)
_E("Fail to get appid. pid(%d)", getpid());
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TIZEN_CPP_COMMON_LOG_TRACER_HH_
+#define TIZEN_CPP_COMMON_LOG_TRACER_HH_
+
+#include <string_view>
+#include <utility>
+
+#include "common/log_private.hh"
+
+namespace tizen_cpp {
+
+class LogTracer {
+ public:
+ explicit LogTracer(std::string_view message) : message_(std::move(message)) {
+ _W("[BEGIN] %s", message_.data());
+ }
+
+ ~LogTracer() {
+ _W("[END] %s", message_.data());
+ }
+
+ private:
+ std::string_view message_;
+};
+
+} // namespace tizen_cpp
+
+#endif // TIZEN_CPP_COMMON_LOG_TRACER_HH_