wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Contact / Person.cpp
old mode 100755 (executable)
new mode 100644 (file)
index c243d0e..c94e087
  */
 
 #include "Person.h"
-
-#include <dpl/log/log.h>
 #include <dpl/exception.h>
 #include <Commons/Exception.h>
 #include <Commons/Regex.h>
 #include "ContactUtility.h"
 #include "ContactsSvcObjectConverter.h"
+#include <Logger.h>
 
 namespace DeviceAPI {
 namespace Contact {
@@ -40,13 +39,13 @@ using namespace std;
 Person::Person()
        : IPerson()
 {
-       LogDebug("entered");
+       LoggerD("entered");
 }
 
 Person::Person(contacts_record_h record)
        : IPerson()
 {
-       LogDebug("entered");
+       LoggerD("entered");
 }
 
 Person::~Person()
@@ -55,7 +54,7 @@ Person::~Person()
 
 void Person::OnRequestReceived(const EventPersonLinkPtr &event)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        int errorCode = 0;
        contacts_record_h contacts_record = NULL;
@@ -89,7 +88,7 @@ void Person::OnRequestReceived(const EventPersonLinkPtr &event)
                contacts_record_destroy(contacts_record, true);
                contacts_record = NULL;
 
-               LogDebug("Linking person : " << personId);
+               LoggerD("Linking person : " << personId);
 
                errorCode = contacts_person_link_person(selfPersonId, personId);
                if(errorCode == CONTACTS_ERROR_INVALID_PARAMETER)
@@ -116,26 +115,26 @@ void Person::OnRequestReceived(const EventPersonLinkPtr &event)
        }
        Catch (InvalidArgumentException)
        {
-               LogError("Invalid person id : " << _rethrown_exception.GetMessage());
+               LoggerE("Invalid person id : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
                return;
        }
        Catch (NotFoundException)
        {
-               LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+               LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::NotFoundException);
                return;
        }
        Catch (PlatformException) {
-               LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+               LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::PlatformException);
                return;
        }
        Catch (Exception) {
-               LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+               LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::PlatformException);
                return;
@@ -144,7 +143,7 @@ void Person::OnRequestReceived(const EventPersonLinkPtr &event)
 
 void Person::OnRequestReceived(const EventPersonUnlinkPtr &event)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        int errorCode = 0;
        int selfPersonId;
@@ -190,7 +189,7 @@ void Person::OnRequestReceived(const EventPersonUnlinkPtr &event)
                        ThrowMsg(OutOfRangeException, "Contact (id:" << contactId << ") is not a member of person");
                }
 
-               LogDebug("Unlinking contact : " << contactId);
+               LoggerD("Unlinking contact : " << contactId);
 
                int newPersonId = 0;
                int errorCode = contacts_person_unlink_contact(selfPersonId, contactId, &newPersonId);
@@ -198,7 +197,7 @@ void Person::OnRequestReceived(const EventPersonUnlinkPtr &event)
                        ThrowMsg(NotFoundException, "Error during executing contacts_person_unlink_contact()");
                else if (errorCode != CONTACTS_ERROR_NONE)
                        ThrowMsg(PlatformException, "Error during executing contacts_person_unlink_contact()");
-               LogDebug("newPersonId : " << newPersonId);
+               LoggerD("newPersonId : " << newPersonId);
 
                errorCode = contacts_db_get_record(_contacts_person._uri, newPersonId, &contacts_record);
                if(errorCode != CONTACTS_ERROR_NONE)
@@ -230,33 +229,33 @@ void Person::OnRequestReceived(const EventPersonUnlinkPtr &event)
        }
        Catch (InvalidArgumentException)
        {
-               LogError("Invalid person id : " << _rethrown_exception.GetMessage());
+               LoggerE("Invalid person id : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
                return;
        }
        Catch (NotFoundException)
        {
-               LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+               LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::NotFoundException);
                return;
        }
        Catch (OutOfRangeException)
        {
-               LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+               LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::OutOfRangeException);
                return;
        }
        Catch (PlatformException) {
-               LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+               LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::PlatformException);
                return;
        }
        Catch (Exception) {
-               LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+               LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
                event->setResult(false);
                event->setExceptionCode(ExceptionCodes::PlatformException);
                return;