From d80c7a7a06efc83e94da1cd0c215cc37393350f0 Mon Sep 17 00:00:00 2001 From: "sung-su.kim" Date: Wed, 11 Sep 2013 21:02:57 +0900 Subject: [PATCH] Define wrt-installer log format [Issue] N/A [Problem] N/A [Cause] Change wrt-installer log form C++ style to C style [Solution] Define wrt-installer log format using wrt-commons log format. - LogDebug/LogError/LogWarning to _D, _E, _W - Error log color change to red. - Define macro for type change from DPL::String to char* [SCMRequest] N/A Change-Id: I1b585b4a93cfaa9ea38da11f5f9fc4860ec0d5d3 --- CMakeLists.txt | 1 + src/commons/installer_log.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/commons/installer_log.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 22515de..24143a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,7 @@ ADD_DEFINITIONS("-Wno-variadic-macros") # Inhibit variadic macros warnings (need ADD_DEFINITIONS("-Wno-deprecated") # No warnings about deprecated features ADD_DEFINITIONS("-std=c++0x") # accept C++11x standard ADD_DEFINITIONS("-DWRT_SMACK_ENABLED") # enable smack +ADD_DEFINITIONS("-DWRT_INSTALLER_LOG") # enable installer log ############################# Targets names ################################### diff --git a/src/commons/installer_log.h b/src/commons/installer_log.h new file mode 100644 index 0000000..fab5b44 --- /dev/null +++ b/src/commons/installer_log.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ +/** + * @file installer_log.h + * @author Sungsu Kim(sung-su.kim@samsung.com) + * @version 0.1 + * @brief + */ + +#ifndef INSTALLER_LOG_H +#define INSTALLER_LOG_H + +#include +#include +#include + +#ifdef WRT_INSTALLER_LOG + +#undef COLOR_WARNING +#define COLOR_WARNING "\e[0m" +#undef COLOR_TAG +#define COLOR_TAG "\e[0m" + +#endif + +#define DPLToChar(DS) { DPL::ToUTF8String(DS).c_str() } + +#endif // INSTALLER_LOG_H + -- 2.7.4