wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Bookmark / JSBookmarkManager.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 637c546..b5ab4a2
 #include <TimeTracer.h>
 
 #include <string>
-#include <dpl/log/log.h>
 #include <vector>
-
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_DEVICEAPI"
+#include <Logger.h>
 
 using namespace std;
 using namespace WrtDeviceApis::CommonsJavaScript;
@@ -103,7 +100,7 @@ bool JSBookmarkManager::hasInstance(JSContextRef context, JSObjectRef constructo
 }
 
 JSValueRef JSBookmarkManager::get(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
-       LogDebug("Entered");
+       LoggerD("Entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
        AceSecurityStatus status = BOOKMARK_CHECK_ACCESS(BOOKMARK_FUNCTION_API_READ_FUNCS);
        TIZEN_SYNC_ACCESS_HANDLER(status, ctx, exception);
@@ -128,12 +125,12 @@ JSValueRef JSBookmarkManager::get(JSContextRef ctx, JSObjectRef object, JSObject
                BookmarkSearchDataPtr searchData(new BookmarkSearchData(parentFolder,reculsive));
                std::vector<BookmarkDataPtr> bookmarkList = BookmarkManager::getInstance()->get(searchData);
                unsigned short bookmarksCount = bookmarkList.size();
-               LogDebug("count : " << bookmarksCount);
+               LoggerD("count : " << bookmarksCount);
                std::vector<JSValueRef> bookmarksArray;
                Converter converter(ctx);
                for (int i = 0; i < bookmarksCount; i++) {
                        JSValueRef bookmark;
-                       LogDebug("bookmarkList["<<i<<"]:" << (bookmarkList[i]->m_title));
+                       LoggerD("bookmarkList["<<i<<"]:" << (bookmarkList[i]->m_title));
                        if (bookmarkList[i]->m_type == BOOKMARKITEM_TYPE)
                                bookmark = static_cast<JSValueRef>(JSBookmarkItem::createJSObject(ctx, bookmarkList[i]->m_title, bookmarkList[i]->m_url, bookmarkList[i]->m_id, bookmarkList[i]->m_parentId));
                        else
@@ -149,7 +146,7 @@ JSValueRef JSBookmarkManager::get(JSContextRef ctx, JSObjectRef object, JSObject
 }
 
 JSValueRef JSBookmarkManager::add(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
-       LogDebug("Entered");
+       LoggerD("Entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
        AceSecurityStatus status = BOOKMARK_CHECK_ACCESS(BOOKMARK_FUNCTION_API_WRITE_FUNCS);
        TIZEN_SYNC_ACCESS_HANDLER(status, ctx, exception);
@@ -161,7 +158,7 @@ JSValueRef JSBookmarkManager::add(JSContextRef ctx, JSObjectRef object, JSObject
                try {
                        bookmarkobj = validator.toObject(0, JSBookmarkItem::getClassRef());
                } catch (const TypeMismatchException& err){
-                       LogDebug("Bookmark's type is not BookmarkItem");
+                       LoggerD("Bookmark's type is not BookmarkItem");
                        bookmarkobj = validator.toObject(0, JSBookmarkFolder::getClassRef());
                }
                BookmarkData * bookmark = static_cast<BookmarkData *>(JSObjectGetPrivate(bookmarkobj));
@@ -192,8 +189,8 @@ JSValueRef JSBookmarkManager::add(JSContextRef ctx, JSObjectRef object, JSObject
 
         bookmark->m_id = BookmarkManager::getInstance()->add(bookmark->m_type, parentId, bookmark->m_title, bookmark->m_url);
                bookmark->m_parentId = parentId;
-               LogDebug("bookmark id:" << bookmark->m_id);
-               LogDebug("bookmark parent id:" << bookmark->m_parentId);
+               LoggerD("bookmark id:" << bookmark->m_id);
+               LoggerD("bookmark parent id:" << bookmark->m_parentId);
                
     }catch( const BasePlatformException& err){
         return JSWebAPIException::throwException(ctx, exception, err);
@@ -204,7 +201,7 @@ JSValueRef JSBookmarkManager::add(JSContextRef ctx, JSObjectRef object, JSObject
 }
 
 JSValueRef JSBookmarkManager::remove(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
-       LogDebug("Entered");
+       LoggerD("Entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
        AceSecurityStatus status = BOOKMARK_CHECK_ACCESS(BOOKMARK_FUNCTION_API_WRITE_FUNCS);
        TIZEN_SYNC_ACCESS_HANDLER(status, ctx, exception);
@@ -216,7 +213,7 @@ JSValueRef JSBookmarkManager::remove(JSContextRef ctx, JSObjectRef object, JSObj
                try {
                        bookmarkobj = validator.toObject(0, JSBookmarkItem::getClassRef(), true);
                } catch (const TypeMismatchException& err){
-                       LogDebug("Bookmark's type is not BookmarkItem");
+                       LoggerD("Bookmark's type is not BookmarkItem");
                        bookmarkobj = validator.toObject(0, JSBookmarkFolder::getClassRef(), true);
                }