[TVChannel] Fix logs
authorPrzemyslaw Ciezkowski <p.ciezkowski@samsung.com>
Fri, 26 Jun 2015 18:00:33 +0000 (20:00 +0200)
committerJuwon(Julia) Ahn <juwon.ahn@samsung.com>
Mon, 29 Jun 2015 11:41:50 +0000 (20:41 +0900)
Change-Id: Ic913ad3937691746a3b6e09295650893ddd36036
Signed-off-by: Przemyslaw Ciezkowski <p.ciezkowski@samsung.com>
(cherry picked from commit 77d6fd76eff964770bcd06c8cc64d187c97a901d)

src/tvchannel/channel_info.cc
src/tvchannel/criteria_filter.cc
src/tvchannel/program_info.cc
src/tvchannel/tune_option.cc
src/tvchannel/tvchannel_instance.cc
src/tvchannel/tvchannel_manager.cc
src/tvchannel/types.cc

index 25af922d85cfd456d857e53dd8c68f22c49f9a02..0e526a5c798350165b56f82eea70dcd744b56132 100644 (file)
@@ -33,7 +33,7 @@ ChannelInfo::~ChannelInfo() {
 }
 
 void ChannelInfo::fromApiData(const TCServiceData &channelData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     m_ptc = channelData.Get<u_int16_t>(CHANNEL_NUMBER);
     m_major = channelData.Get<u_int16_t>(MAJOR);
     m_minor = channelData.Get<u_int16_t>(MINOR);
@@ -73,10 +73,10 @@ void ChannelInfo::setChannelName(std::string channelName) {
 }
 
 void ChannelInfo::setChannelName(const TCServiceData &channelData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     size_t len = channelData.GetLength(SERVICE_NAME);
     if (len) {
-        LOGD("ServiceName length %d", len);
+        LoggerD("ServiceName length %d", len);
         size_t c_len = len * sizeof(t_wchar_t) / sizeof(char);
         t_wchar_t svc_name[len + 1];
         channelData.Get(SERVICE_NAME, svc_name);
index 81eb9a30f6ea0aecdd039c519158423720eb8dba..942d773444773371dde36cafd940d52dc7e16f69 100644 (file)
@@ -27,16 +27,16 @@ CriteriaFilter::CriteriaFilter(EServiceMode _mode) :
 void CriteriaFilter::filterWhere(int32_t columnName,
     const int32_t columnValue) {
     if (m_mode == SERVICE_MODE_ATSC && columnName == ORIGINAL_NETWORK_ID) {
-        LOGD("ORIGINAL_NETWORK_ID not supported");
+        LoggerD("ORIGINAL_NETWORK_ID not supported");
         return;
     }
     if ((m_mode == SERVICE_MODE_DVB || m_mode == SERVICE_MODE_DVBNT)
         && (columnName == MINOR || columnName == SOURCE_ID)) {
-        LOGD("%d not supported", columnName);
+        LoggerD("%d not supported", columnName);
         return;
     }
     if (m_mode == SERVICE_MODE_ISDB && columnName == SOURCE_ID) {
-        LOGD("SOURCE_ID not supported");
+        LoggerD("SOURCE_ID not supported");
         return;
     }
 
index 6048be3b2fd0676c22082cec1cbd53c56d6e101b..2b7b740cccb6d0449a6df6abb84fc77cf68eb19c 100644 (file)
@@ -34,7 +34,7 @@ ProgramInfo::~ProgramInfo() {
 }
 
 void ProgramInfo::fromApiData(const TCProgramData &data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     setTitle(data);
     m_startTime = data.StartTime();
     m_duration = data.EndTime() - m_startTime;
@@ -47,7 +47,7 @@ std::string ProgramInfo::getTitle() const {
 }
 
 void ProgramInfo::setTitle(const TCProgramData &data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         unsigned int len;
         size_t c_len;
@@ -55,7 +55,7 @@ void ProgramInfo::setTitle(const TCProgramData &data) {
 
         len = data.TitleLength();
         if (len) {
-            LOGD("Title length %d", len);
+            LoggerD("Title length %d", len);
             title = new t_wchar_t[len + 1];
             TCProgramData copy = data;
             copy.Title(title, &len);
@@ -69,7 +69,7 @@ void ProgramInfo::setTitle(const TCProgramData &data) {
             m_title = "";
         }
     } catch (...) {
-        LOGD("There is some problem on text encoding.");
+        LoggerD("There is some problem on text encoding.");
         m_title = "";
     }
 }
@@ -107,14 +107,14 @@ void ProgramInfo::setDetailedDescription(std::string detailedDescription) {
 }
 
 void ProgramInfo::setDetailedDescription(const TCProgramData &data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         unsigned int len;
         size_t c_len;
         t_wchar_t *description;
 
         len = data.ExtendedTextLength();
-        LOGD("Description length %d", len);
+        LoggerD("Description length %d", len);
         if (len) {
             description = new t_wchar_t[len + 1];
             TCProgramData copy = data;
@@ -131,7 +131,7 @@ void ProgramInfo::setDetailedDescription(const TCProgramData &data) {
             m_detailedDescription = "";
         }
     } catch (...) {
-        LOGD("There is some problem on text encoding.");
+        LoggerD("There is some problem on text encoding.");
         m_detailedDescription = "";
     }
 }
index 65f69067d45ba492251f55c3b4757d97ff692c26..fb3fb621741b74bd90a484149951e2895520ee5e 100644 (file)
@@ -46,7 +46,7 @@ TuneOption::~TuneOption() {
 }
 
 TuneOption::TuneOption(picojson::object const& _tuneDict) {
-    LOGD("Enter");
+    LoggerD("Enter");
     initialize();
     picojson::object tuneDict = _tuneDict;
     if (tuneDict.find("major") != tuneDict.end()) {
index 7d1d1c33618ce6a05cc258f8900e1bb570be6b5c..6649c690a6a4dd0c2ac41c5776a8e34df80efc21 100644 (file)
@@ -63,12 +63,12 @@ TVChannelInstance::TVChannelInstance() {
 }
 
 TVChannelInstance::~TVChannelInstance() {
-    LOGD("Entered");
+    LoggerD("Entered");
 }
 
 void TVChannelInstance::tune(picojson::value const& args,
     picojson::object& out) {
-    LOGD("Enter");
+    LoggerD("Enter");
     picojson::object tuneOption =
         args.get("tuneOption").get<picojson::object>();
     double callbackId = args.get("callbackId").get<double>();
@@ -79,7 +79,7 @@ void TVChannelInstance::tune(picojson::value const& args,
         windowType = "MAIN";
     }
 
-    LOGD("CallbackID %f", callbackId);
+    LoggerD("CallbackID %f", callbackId);
     std::shared_ptr<TVChannelManager::TuneData> pTuneData(
         new TVChannelManager::TuneData(TuneOption(tuneOption),
             stringToWindowType(windowType), callbackId));
@@ -100,7 +100,7 @@ void TVChannelInstance::tune(picojson::value const& args,
 
 void TVChannelInstance::tuneTaskAfter(
     std::shared_ptr<TVChannelManager::TuneData> const& _tuneData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     if (_tuneData->pError) {
         picojson::value event = picojson::value(picojson::object());
         picojson::object& obj = event.get<picojson::object>();
@@ -113,13 +113,13 @@ void TVChannelInstance::tuneTaskAfter(
 
 void TVChannelInstance::tuneTask(
     std::shared_ptr<TVChannelManager::TuneData> const& _tuneData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     TVChannelManager::getInstance()->tune(_tuneData);
 }
 
 void TVChannelInstance::tuneUp(picojson::value const& args,
     picojson::object& out) {
-    LOGD("Enter");
+    LoggerD("Enter");
 
     NavigatorMode navMode;
     if (args.contains("tuneMode")) {
@@ -137,7 +137,7 @@ void TVChannelInstance::tuneUp(picojson::value const& args,
         windowType = "MAIN";
     }
 
-    LOGD("CallbackID %f", callbackId);
+    LoggerD("CallbackID %f", callbackId);
     std::shared_ptr<TVChannelManager::TuneData> pTuneData(
         new TVChannelManager::TuneData(navMode,
             stringToWindowType(windowType), callbackId));
@@ -163,7 +163,7 @@ void TVChannelInstance::tuneUpTask(
 
 void TVChannelInstance::tuneDown(picojson::value const& args,
     picojson::object& out) {
-    LOGD("Enter");
+    LoggerD("Enter");
 
     NavigatorMode navMode;
     if (args.contains("tuneMode")) {
@@ -181,7 +181,7 @@ void TVChannelInstance::tuneDown(picojson::value const& args,
         windowType = "MAIN";
     }
 
-    LOGD("CallbackID %f", callbackId);
+    LoggerD("CallbackID %f", callbackId);
     std::shared_ptr<TVChannelManager::TuneData> pTuneData(
         new TVChannelManager::TuneData(navMode,
             stringToWindowType(windowType), callbackId));
@@ -291,7 +291,7 @@ void TVChannelInstance::getCurrentProgram(const picojson::value& args,
 }
 
 void TVChannelInstance::onChannelChange(double callbackId) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         WindowType windowType = stringToWindowType("MAIN");
 
@@ -311,9 +311,9 @@ void TVChannelInstance::onChannelChange(double callbackId) {
             PostMessage(resultCallback.serialize().c_str());
         }
     } catch (common::PlatformException& e) {
-        LOGW("Failed to post message: %s", e.message().c_str());
+        LoggerW("Failed to post message: %s", e.message().c_str());
     } catch (...) {
-        LOGW("Failed to post message, unknown error");
+        LoggerW("Failed to post message, unknown error");
     }
 }
 
@@ -328,9 +328,9 @@ void TVChannelInstance::onEPGReceived(double callbackId) {
         picojson::value result(dict);
         PostMessage(result.serialize().c_str());
     } catch (common::PlatformException& e) {
-        LOGW("Failed to post message: %s", e.message().c_str());
+        LoggerW("Failed to post message: %s", e.message().c_str());
     } catch (...) {
-        LOGW("Failed to post message, unknown error");
+        LoggerW("Failed to post message, unknown error");
     }
 }
 void TVChannelInstance::onNoSignal(double callbackId) {
@@ -342,15 +342,15 @@ void TVChannelInstance::onNoSignal(double callbackId) {
         picojson::value result(dict);
         PostMessage(result.serialize().c_str());
     } catch (common::PlatformException& e) {
-        LOGW("Failed to post message: %s", e.message().c_str());
+        LoggerW("Failed to post message: %s", e.message().c_str());
     } catch (...) {
-        LOGW("Failed to post message, unknown error");
+        LoggerW("Failed to post message, unknown error");
     }
 }
 
 void TVChannelInstance::findChannel(const picojson::value& args,
     picojson::object& out) {
-    LOGD("Enter");
+    LoggerD("Enter");
     std::function<void(std::shared_ptr<TVChannelManager::FindChannelData>)>
         asyncWork = std::bind(
             &TVChannelManager::findChannel,
@@ -376,7 +376,7 @@ void TVChannelInstance::findChannel(const picojson::value& args,
 
 void TVChannelInstance::findChannelResult(
     const std::shared_ptr<TVChannelManager::FindChannelData>& data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     picojson::value::object dict;
     dict["callbackId"] = picojson::value(data->callbackId);
     if (data->error) {
@@ -397,7 +397,7 @@ void TVChannelInstance::findChannelResult(
 
 void TVChannelInstance::getChannelList(const picojson::value& args,
     picojson::object& out) {
-    LOGD("Enter");
+    LoggerD("Enter");
     std::function<void(std::shared_ptr<TVChannelManager::GetChannelListData>)>
         asyncWork = std::bind(
             &TVChannelManager::getChannelList,
@@ -462,7 +462,7 @@ void TVChannelInstance::getChannelListResult(
 
 void TVChannelInstance::getProgramList(
     const picojson::value& args, picojson::object& out) {
-    LOGD("Enter");
+    LoggerD("Enter");
     std::function<void(std::shared_ptr<TVChannelManager::GetProgramListData>)>
         asyncWork = std::bind(
             &TVChannelManager::getProgramList,
index 16554ec3e97459d0ad8c77e6cfcdafb1d79001fe..58fc3059f5c4f7c536491ea5472dd7424d681aa2 100644 (file)
@@ -36,10 +36,10 @@ TVChannelManager* TVChannelManager::getInstance() {
 
 TVChannelManager::TVChannelManager() :
     m_listener(NULL) {
-    LOGD("Enter");
+    LoggerD("Enter");
     int ret = TVServiceAPI::CreateService(&m_pService);
     if (TV_SERVICE_API_SUCCESS != ret) {
-        LOGE("Failed to create tvs-api service: %d", ret);
+        LoggerE("Failed to create tvs-api service: %d", ret);
         throw common::UnknownException("Failed to create tvs-api service");
     }
 }
@@ -49,7 +49,7 @@ IService* TVChannelManager::getService() {
 }
 
 void TVChannelManager::tune(std::shared_ptr<TuneData> const& _pTuneData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         std::unique_lock<std::mutex> lock(tuneMutex);
 
@@ -72,35 +72,35 @@ void TVChannelManager::tune(std::shared_ptr<TuneData> const& _pTuneData) {
         CriteriaFilter filter = CriteriaFilter(tvMode.serviceMode);
 
         if (tuneOption.isMajorSet()) {
-            LOGD("MAJOR: %d", tuneOption.getMajor());
+            LoggerD("MAJOR: %d", tuneOption.getMajor());
             filter.filterWhere(MAJOR, static_cast<int>(tuneOption.getMajor()));
         }
         if (tuneOption.isMinorSet()) {
-            LOGD("MINOR: %d", tuneOption.getMinor());
+            LoggerD("MINOR: %d", tuneOption.getMinor());
             filter.filterWhere(MINOR, static_cast<int>(tuneOption.getMinor()));
         }
         if (tuneOption.isPtcSet()) {
-            LOGD("PTC: %d", tuneOption.getPtc());
+            LoggerD("PTC: %d", tuneOption.getPtc());
             filter.filterWhere(CHANNEL_NUMBER,
                 static_cast<int>(tuneOption.getPtc()));
         }
         if (tuneOption.isOriginalNetworkIDSet()) {
-            LOGD("ORIGINAL_NETWORK_ID: %d", tuneOption.getOriginalNetworkID());
+            LoggerD("ORIGINAL_NETWORK_ID: %d", tuneOption.getOriginalNetworkID());
             filter.filterWhere(ORIGINAL_NETWORK_ID,
                 static_cast<int>(tuneOption.getOriginalNetworkID()));
         }
         if (tuneOption.isProgramNumberSet()) {
-            LOGD("PROGRAM_NUMBER: %d", tuneOption.getProgramNumber());
+            LoggerD("PROGRAM_NUMBER: %d", tuneOption.getProgramNumber());
             filter.filterWhere(PROGRAM_NUMBER,
                 static_cast<int>(tuneOption.getProgramNumber()));
         }
         if (tuneOption.isSourceIDSet()) {
-            LOGD("SOURCE_ID: %d", tuneOption.getSourceID());
+            LoggerD("SOURCE_ID: %d", tuneOption.getSourceID());
             filter.filterWhere(SOURCE_ID,
                 static_cast<int>(tuneOption.getSourceID()));
         }
         if (tuneOption.isTransportStreamIDSet()) {
-            LOGD("TRANSPORT_STREAM_ID: %d", tuneOption.getTransportStreamID());
+            LoggerD("TRANSPORT_STREAM_ID: %d", tuneOption.getTransportStreamID());
             filter.filterWhere(TRANSPORT_STREAM_ID,
                 static_cast<int>(tuneOption.getTransportStreamID()));
         }
@@ -110,7 +110,7 @@ void TVChannelManager::tune(std::shared_ptr<TuneData> const& _pTuneData) {
         TCServiceData foundService;
         int ret = getService()->FindService(*pCriteria, foundService);
         if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-            LOGE("Failed to find channel: %d", ret);
+            LoggerE("Failed to find channel: %d", ret);
             throw common::NotFoundException("Failed to find channel");
         }
 
@@ -122,7 +122,7 @@ void TVChannelManager::tune(std::shared_ptr<TuneData> const& _pTuneData) {
 
         ret = getNavigation(getProfile(windowType), 0)->SetService(serviceId);
         if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-            LOGE("Failed to set selected channel: %d", ret);
+            LoggerE("Failed to set selected channel: %d", ret);
             throw common::UnknownException(
                 "Failed to set selected channel");
         }
@@ -131,7 +131,7 @@ void TVChannelManager::tune(std::shared_ptr<TuneData> const& _pTuneData) {
     } catch (common::PlatformException const& _error) {
         _pTuneData->pError.reset(
             new common::PlatformException(_error.name(), _error.message()));
-        LOGE("Some exception caught");
+        LoggerE("Some exception caught");
     }
 }
 
@@ -149,7 +149,7 @@ ENavigationMode navigatorModeToENavigationMode(NavigatorMode mode) {
 }
 
 void TVChannelManager::tuneUp(std::shared_ptr<TuneData> const& _pTuneData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         std::unique_lock<std::mutex> lock(tuneMutex);
 
@@ -175,7 +175,7 @@ void TVChannelManager::tuneUp(std::shared_ptr<TuneData> const& _pTuneData) {
                 currentServiceId,
                 previousService);
         if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-            LOGE("Failed to find previous channel: %d", ret);
+            LoggerE("Failed to find previous channel: %d", ret);
             throw common::NotFoundException("Failed to find previous channel");
         }
         TCServiceId serviceId = previousService.Get<TCServiceId>(SERVICE_ID);
@@ -183,12 +183,12 @@ void TVChannelManager::tuneUp(std::shared_ptr<TuneData> const& _pTuneData) {
         // if GetNextService's result is same with current service id,
         // it means failure to find previous channel.
         if (currentServiceId == serviceId) {
-            LOGE("Failed to find previous channel: %d", ret);
+            LoggerE("Failed to find previous channel: %d", ret);
             throw common::NotFoundException("Failed to find next channel");
         }
         ret = getNavigation(getProfile(windowType), 0)->SetService(serviceId);
         if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-            LOGE("Failed to set selected channel: %d", ret);
+            LoggerE("Failed to set selected channel: %d", ret);
             throw common::UnknownException(
                 "Failed to set selected channel");
         }
@@ -196,12 +196,12 @@ void TVChannelManager::tuneUp(std::shared_ptr<TuneData> const& _pTuneData) {
     } catch (common::PlatformException const& _error) {
         _pTuneData->pError.reset(
             new common::PlatformException(_error.name(), _error.message()));
-        LOGE("Some exception caught");
+        LoggerE("Some exception caught");
     }
 }
 
 void TVChannelManager::tuneDown(std::shared_ptr<TuneData> const& _pTuneData) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         std::unique_lock<std::mutex> lock(tuneMutex);
 
@@ -227,7 +227,7 @@ void TVChannelManager::tuneDown(std::shared_ptr<TuneData> const& _pTuneData) {
                 currentServiceId,
                 nextService);
         if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-            LOGE("Failed to find previous channel: %d", ret);
+            LoggerE("Failed to find previous channel: %d", ret);
             throw common::NotFoundException("Failed to find previous channel");
         }
         TCServiceId serviceId = nextService.Get<TCServiceId>(SERVICE_ID);
@@ -235,12 +235,12 @@ void TVChannelManager::tuneDown(std::shared_ptr<TuneData> const& _pTuneData) {
         // if GetNextService's result is same with current service id,
         // it means failure to find previous channel.
         if (currentServiceId == serviceId) {
-            LOGE("Failed to find previous channel: %d", ret);
+            LoggerE("Failed to find previous channel: %d", ret);
             throw common::NotFoundException("Failed to find previous channel");
         }
         ret = getNavigation(getProfile(windowType), 0)->SetService(serviceId);
         if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-            LOGE("Failed to set selected channel: %d", ret);
+            LoggerE("Failed to set selected channel: %d", ret);
             throw common::UnknownException(
                 "Failed to set selected channel");
         }
@@ -248,44 +248,44 @@ void TVChannelManager::tuneDown(std::shared_ptr<TuneData> const& _pTuneData) {
     } catch (common::PlatformException const& _error) {
         _pTuneData->pError.reset(
             new common::PlatformException(_error.name(), _error.message()));
-        LOGE("Some exception caught");
+        LoggerE("Some exception caught");
     }
 }
 
 IServiceNavigation* TVChannelManager::getNavigation(EProfile profileId,
     u_int16_t screenId) {
-    LOGD("Enter");
+    LoggerD("Enter");
     IServiceNavigation* navigation;
     int ret = TVServiceAPI::CreateServiceNavigation(profileId, screenId,
         &navigation);
     if (TV_SERVICE_API_SUCCESS != ret) {
-        LOGE("Failed to create service navigation: %d", ret);
+        LoggerE("Failed to create service navigation: %d", ret);
         throw common::UnknownException("Failed to create service navigation");
     }
     return navigation;
 }
 
 TSTvMode TVChannelManager::getTvMode(IServiceNavigation* pNavigation) {
-    LOGD("Enter");
+    LoggerD("Enter");
     TSTvMode tvMode;
     int ret = pNavigation->GetTvMode(tvMode);
     if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-        LOGE("Failed to get current tv mode: %d", ret);
+        LoggerE("Failed to get current tv mode: %d", ret);
         throw common::UnknownException("Failed to get current tv mode");
     }
-    LOGD("tvMode : antenna - %d, service - %d", tvMode.antennaMode,
+    LoggerD("tvMode : antenna - %d, service - %d", tvMode.antennaMode,
         tvMode.serviceMode);
     return tvMode;
 }
 
 std::unique_ptr<TCCriteriaHelper> TVChannelManager::getBasicCriteria(
     TSTvMode tvMode, ENavigationMode naviMode) {
-    LOGD("Enter");
+    LoggerD("Enter");
     std::unique_ptr < TCCriteriaHelper > pCriteria(new TCCriteriaHelper());
     bool found = TCNavigationModeHelper::GetNavigationCriteria(tvMode, naviMode,
         *pCriteria);
     if (!found) {
-        LOGE("Failed to create navigation criteria");
+        LoggerE("Failed to create navigation criteria");
         throw common::UnknownException("Failed to create navigation criteria");
     }
     return pCriteria;
@@ -294,12 +294,12 @@ std::unique_ptr<TCCriteriaHelper> TVChannelManager::getBasicCriteria(
 TCServiceData TVChannelManager::getCurrentServiceInfo(
     IServiceNavigation* _pNavigation, TSTvMode _mode,
     std::unique_ptr<TCCriteriaHelper> const& _pCriteria) {
-    LOGD("Enter");
+    LoggerD("Enter");
     TCServiceData serviceData;
     int ret = _pNavigation->GetCurrentServiceInfo(_mode, *_pCriteria,
         serviceData);
     if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-        LOGE("Failed to get current service info: %d", ret);
+        LoggerE("Failed to get current service info: %d", ret);
         throw common::UnknownException("Failed to get current service info");
     }
     return serviceData;
@@ -307,7 +307,7 @@ TCServiceData TVChannelManager::getCurrentServiceInfo(
 
 std::unique_ptr<ChannelInfo> TVChannelManager::getCurrentChannel(
     WindowType _windowType) {
-    LOGD("Entered %d", _windowType);
+    LoggerD("Entered %d", _windowType);
 
     std::unique_ptr < TCCriteriaHelper > pCriteria(new TCCriteriaHelper());
     pCriteria->Fetch(SERVICE_ID);
@@ -330,7 +330,7 @@ std::unique_ptr<ChannelInfo> TVChannelManager::getCurrentChannel(
 
     TCServiceData serviceData = getCurrentServiceInfo(navigation, tvMode,
         pCriteria);
-    LOGD("Current channel id: %llu",
+    LoggerD("Current channel id: %llu",
         serviceData.Get < TCServiceId > (SERVICE_ID));
     std::unique_ptr<ChannelInfo> pChannel(new ChannelInfo());
     pChannel->fromApiData(serviceData);
@@ -338,7 +338,7 @@ std::unique_ptr<ChannelInfo> TVChannelManager::getCurrentChannel(
 }
 
 EProfile TVChannelManager::getProfile(WindowType windowType) {
-    LOGD("Enter");
+    LoggerD("Enter");
     switch (windowType) {
     case MAIN:
         return PROFILE_TYPE_MAIN;
@@ -346,12 +346,12 @@ EProfile TVChannelManager::getProfile(WindowType windowType) {
 //      case PIP:
 //          return PROFILE_TYPE_PIP;
     default:
-        LOGE("Unsupported window type: %d", windowType);
+        LoggerE("Unsupported window type: %d", windowType);
     }
 }
 
 TCServiceId TVChannelManager::getCurrentChannelId(WindowType _windowType) {
-    LOGD("Enter");
+    LoggerD("Enter");
     //  Navigation
     IServiceNavigation* navigation = getNavigation(getProfile(_windowType),
         SCREENID);
@@ -364,11 +364,11 @@ TCServiceId TVChannelManager::getCurrentChannelId(WindowType _windowType) {
 }
 
 ProgramInfo* TVChannelManager::getCurrentProgram(WindowType _windowType) {
-    LOGD("Enter");
+    LoggerD("Enter");
     IServiceGuide* guide;
     int ret = TVServiceAPI::CreateServiceGuide(&guide);
     if (TV_SERVICE_API_SUCCESS != ret) {
-        LOGE("Failed to create service guide: %d", ret);
+        LoggerE("Failed to create service guide: %d", ret);
         throw common::UnknownException("Failed to create service guide");
     }
 
@@ -376,7 +376,7 @@ ProgramInfo* TVChannelManager::getCurrentProgram(WindowType _windowType) {
     ret = guide->GetPresentProgram(getCurrentChannelId(_windowType),
         programData);
     if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-        LOGE("Failed to get current program: %d", ret);
+        LoggerE("Failed to get current program: %d", ret);
         throw common::UnknownException("Failed to get current program");
     }
     ProgramInfo* program = new ProgramInfo();
@@ -386,41 +386,41 @@ ProgramInfo* TVChannelManager::getCurrentProgram(WindowType _windowType) {
 
 ISignalSubscriber* TVChannelManager::createSubscriber(
     EventListener* pListener) {
-    LOGD("Enter");
+    LoggerD("Enter");
     m_listener = pListener;
     ISignalSubscriber* pSubscriber;
     int ret = TVServiceAPI::CreateSignalSubscriber(signalListener,
         &pSubscriber);
     if (TV_SERVICE_API_SUCCESS != ret) {
-        LOGW("Failed to create tvs-api SignalSubscriber");
+        LoggerW("Failed to create tvs-api SignalSubscriber");
     }
     return pSubscriber;
 }
 
 void TVChannelManager::registerListener(ISignalSubscriber* pSubscriber) {
-    LOGD("Enter");
+    LoggerD("Enter");
     pSubscriber->Unsubscribe(SIGNAL_TUNE_SUCCESS);
     int ret = pSubscriber->Subscribe(SIGNAL_TUNE_SUCCESS);
     if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-        LOGW("Failed to add listener: SIGNAL_TUNE_SUCCESS");
+        LoggerW("Failed to add listener: SIGNAL_TUNE_SUCCESS");
     }
     pSubscriber->Unsubscribe(SIGNAL_TUNER_LOCK_FAIL);
     ret = pSubscriber->Subscribe(SIGNAL_TUNER_LOCK_FAIL);
     if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-        LOGW("Failed to add listener: SIGNAL_TUNER_LOCK_FAIL");
+        LoggerW("Failed to add listener: SIGNAL_TUNER_LOCK_FAIL");
     }
     pSubscriber->Unsubscribe(SIGNAL_EPG_COMPLETED);
     ret = pSubscriber->Subscribe(SIGNAL_EPG_COMPLETED);
     if (TV_SERVICE_API_METHOD_SUCCESS != ret) {
-        LOGW("Failed to add listener: SIGNAL_EPG_COMPLETED");
+        LoggerW("Failed to add listener: SIGNAL_EPG_COMPLETED");
     }
 }
 
 int TVChannelManager::signalListener(ESignalType type, EProfile _profile,
     u_int16_t _screenID, TSSignalData data, void*) {
-    LOGD("Enter: %d", type);
+    LoggerD("Enter: %d", type);
     if (!getInstance()->m_listener) {
-        LOGE("Listener is empty, ignoring message");
+        LoggerE("Listener is empty, ignoring message");
         return 0;
     }
 
@@ -431,7 +431,7 @@ int TVChannelManager::signalListener(ESignalType type, EProfile _profile,
     if (it != getInstance()->m_callbackTuneMap.end()) {
         callbackID = it->second;
     }
-    LOGD("CallbackID %f", callbackID);
+    LoggerD("CallbackID %f", callbackID);
 
     switch (type) {
     case SIGNAL_TUNE_SUCCESS:
@@ -444,7 +444,7 @@ int TVChannelManager::signalListener(ESignalType type, EProfile _profile,
         getInstance()->m_listener->onEPGReceived(callbackID);
         break;
     default:
-        LOGW("Unrecognized event type");
+        LoggerW("Unrecognized event type");
     }
     return 0;
 }
@@ -456,12 +456,12 @@ void TVChannelManager::ucs2utf8(char *out, size_t out_len, char *in,
 
     cd = iconv_open("UTF-8", "UCS-2BE");
     if (cd == (iconv_t) - 1) {
-        LOGE("Failed to open iconv");
+        LoggerE("Failed to open iconv");
     }
 
     r = iconv(cd, &in, &in_len, &out, &out_len);
     if (r == (size_t) - 1) {
-        LOGE("Failed convert string to utf8");
+        LoggerE("Failed convert string to utf8");
     }
 
     iconv_close(cd);
@@ -469,7 +469,7 @@ void TVChannelManager::ucs2utf8(char *out, size_t out_len, char *in,
 
 void TVChannelManager::findChannel(
     const std::shared_ptr<FindChannelData>& data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         IServiceNavigation* navigation =
             getNavigation(getProfile(WindowType::MAIN), 0);
@@ -497,10 +497,10 @@ void TVChannelManager::findChannel(
         std::list<TCServiceData*> resultServices;
         int ret = m_pService->FindServiceList(*criteria, resultServices);
         if (TV_SERVICE_API_METHOD_FAILURE == ret) {
-            LOGE("Failed to find channel: %d", ret);
+            LoggerE("Failed to find channel: %d", ret);
             throw common::NotFoundException("Failed to find channel");
         }
-        LOGD("Found channels: %d", resultServices.size());
+        LoggerD("Found channels: %d", resultServices.size());
         auto it = resultServices.begin();
         for (; it != resultServices.end(); ++it) {
             ChannelInfo *channelInfo = new ChannelInfo();
@@ -519,7 +519,7 @@ void TVChannelManager::findChannel(
 
 void TVChannelManager::getChannelList(
     const std::shared_ptr<GetChannelListData>& data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         IServiceNavigation* navigation =
             getNavigation(getProfile(WindowType::MAIN), 0);
@@ -558,10 +558,10 @@ void TVChannelManager::getChannelList(
         std::list<TCServiceData*> resultServices;
         int ret = m_pService->FindServiceList(*criteria, resultServices);
         if (TV_SERVICE_API_METHOD_FAILURE == ret) {
-            LOGE("Failed to find channels: %d", ret);
+            LoggerE("Failed to find channels: %d", ret);
             throw common::NotFoundException("Failed to find channels");
         }
-        LOGD("Found channels: %d", resultServices.size());
+        LoggerD("Found channels: %d", resultServices.size());
         auto it = resultServices.begin();
         for (; it != resultServices.end(); ++it) {
             ChannelInfo *channelInfo = new ChannelInfo();
@@ -580,12 +580,12 @@ void TVChannelManager::getChannelList(
 
 void TVChannelManager::getProgramList(
     const std::shared_ptr<GetProgramListData>& data) {
-    LOGD("Enter");
+    LoggerD("Enter");
     try {
         IServiceGuide* guide;
         int ret = TVServiceAPI::CreateServiceGuide(&guide);
         if (TV_SERVICE_API_SUCCESS != ret) {
-            LOGE("Failed to create service guide: %d", ret);
+            LoggerE("Failed to create service guide: %d", ret);
             throw common::UnknownException("Failed to create service guide");
         }
 
@@ -593,10 +593,10 @@ void TVChannelManager::getProgramList(
         ret = guide->GetProgramList(data->channelId,
             data->startTime, data->duration, programList);
         if (TV_SERVICE_API_METHOD_FAILURE == ret) {
-            LOGE("Failed to get program list.");
+            LoggerE("Failed to get program list.");
             throw common::NotFoundException("Failed to get program list.");
         }
-        LOGD("Found programs: %d", programList.size());
+        LoggerD("Found programs: %d", programList.size());
 
         auto it = programList.begin();
         for (; it != programList.end(); ++it) {
index 671443b632b93d0371235224a51caca1c7c7d39b..7dd7096e3eded116659c745d2d4d823ea640f608 100644 (file)
@@ -39,7 +39,7 @@ NavigatorMode stringToNavigatorMode(const std::string &mode) {
     if (mode == NAVIGATOR_MODE_FAVORITE) {
         return NavigatorMode::FAVORITE;
     }
-    LOGE("Unrecognized mode");
+    LoggerE("Unrecognized mode");
     throw common::UnknownException("Unrecognized mode");
 }
 
@@ -57,7 +57,7 @@ std::string windowTypeToString(WindowType type) {
 //          return TIZEN_TV_WINDOW_TYPE_PIP;
 //          break;
     default:
-        LOGE("Unrecognized window type: %d", type);
+        LoggerE("Unrecognized window type: %d", type);
         throw common::UnknownException("Unrecognized window type");
     }
 }
@@ -69,7 +69,7 @@ WindowType stringToWindowType(std::string type) {
 //  } else if (type == TIZEN_TV_WINDOW_TYPE_PIP) {
 //      return PIP;
     } else {
-        LOGE("Unrecognized window type: %s", type.c_str());
+        LoggerE("Unrecognized window type: %s", type.c_str());
         throw common::UnknownException("Unrecognized window type");
     }
 }