wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Calendar / JSCalendarRecurrenceRule.cpp
old mode 100755 (executable)
new mode 100644 (file)
index aaa4e73..a404985
 // limitations under the License.
 //
 
-
 #include "JSCalendarRecurrenceRule.h"
-#include <dpl/log/log.h>
 #include <JSTizenException.h>
 #include <JSTizenExceptionFactory.h>
 #include <CommonsJavaScript/Converter.h>
 #include "CalendarConverter.h"
 #include <TimeUtilConverter.h>
 #include <JSTZDate.h>
-
 #include <GlobalContextManager.h>
+#include <Logger.h>
 
 using namespace WrtDeviceApis::Commons;
 using namespace WrtDeviceApis::CommonsJavaScript;
@@ -95,14 +93,14 @@ JSObjectRef JSCalendarRecurrenceRule::createJSCalendarRecurrenceRule(JSContextRe
 void JSCalendarRecurrenceRule::initialize(JSContextRef context, JSObjectRef object)
 {
     if (!JSObjectGetPrivate(object)) {
-        LogDebug("Create calendar rrule private object.");
+        LoggerD("Create calendar rrule private object.");
         EventRecurrenceRulePtr rrule( new EventRecurrenceRule() );
         RecurrenceRulePrivateObject *priv = new RecurrenceRulePrivateObject(context, rrule);
         if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
             delete priv;
         }
     } else {
-        LogDebug("Private object already set.");
+        LoggerD("Private object already set.");
     }
 }
 
@@ -145,7 +143,7 @@ void JSCalendarRecurrenceRule::setPrivateObject(const EventRecurrenceRulePtr &rr
     }
     Catch(Exception)
     {
-        LogError("Error during replacing rrule object.");
+        LoggerE("Error during replacing rrule object.");
     }
 }
 
@@ -189,22 +187,22 @@ JSObjectRef JSCalendarRecurrenceRule::constructor(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -246,7 +244,7 @@ JSValueRef JSCalendarRecurrenceRule::getProperty(JSContextRef context,
                        if(rrule->getDaysOfTheWeekJSRef()) {
                                return rrule->getDaysOfTheWeekJSRef();
                        } else {
-                               LogDebug("Create a JS object for daysOfTheWeek.");
+                               LoggerD("Create a JS object for daysOfTheWeek.");
                        StringArrayPtr daysOfTheWeek = rrule->getDaysOfTheWeek();
                                JSValueRef jsDaysOfTheWeek = converter.toJSValueRefStringArray(daysOfTheWeek);
                                rrule->setDaysOfTheWeekJSRef(converter.toJSObjectRef(jsDaysOfTheWeek));
@@ -263,7 +261,7 @@ JSValueRef JSCalendarRecurrenceRule::getProperty(JSContextRef context,
                        if(rrule->getSetPositionsJSRef()) {
                                return rrule->getSetPositionsJSRef();
                        } else {
-                               LogDebug("Create a JS object for setPositions.");
+                               LoggerD("Create a JS object for setPositions.");
                                NumberArrayPtr setPositions = rrule->getSetPositions();
                                JSValueRef jsSetPositions = converter.toJSValueRefNumberArray(setPositions);
                                rrule->setSetPositionsJSRef(converter.toJSObjectRef(jsSetPositions));
@@ -276,7 +274,7 @@ JSValueRef JSCalendarRecurrenceRule::getProperty(JSContextRef context,
                        if(rrule->getExceptionsJSRef()) {
                                return rrule->getExceptionsJSRef();
                        } else {
-                               LogDebug("Create a JS object for exceptions with time zone: "<<rrule->getTimeZone());
+                               LoggerD("Create a JS object for exceptions with time zone: "<<rrule->getTimeZone());
                                NumberArrayPtr exceptions = rrule->getExceptions();
                                JSValueRef jsExceptions = converter.toJSValueRefTZDateArray(exceptions, rrule->getTimeZone());
                                rrule->setExceptionsJSRef(converter.toJSObjectRef(jsExceptions));
@@ -289,7 +287,7 @@ JSValueRef JSCalendarRecurrenceRule::getProperty(JSContextRef context,
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     }
     return JSValueMakeUndefined(context);
 }
@@ -361,7 +359,7 @@ bool JSCalendarRecurrenceRule::setProperty(JSContextRef context,
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     }
 
     return true;