Refactor log system
[platform/core/security/cert-svc.git] / vcore / src / vcore / SignatureValidator.cpp
index 2a51402..3ceebd7 100644 (file)
@@ -30,7 +30,7 @@
 #include <vcore/CertificateVerifier.h>
 #endif
 
-#include <dpl/log/wrt_log.h>
+#include <dpl/log/log.h>
 
 namespace {
 const time_t TIMET_DAY = 60 * 60 * 24;
@@ -114,18 +114,18 @@ public:
         std::string roleURI = data.getRoleURI();
 
         if (roleURI.empty()) {
-            WrtLogW("URI attribute in Role tag couldn't be empty.");
+            LogWarning("URI attribute in Role tag couldn't be empty.");
             return false;
         }
 
         if (roleURI != TOKEN_ROLE_AUTHOR_URI && data.isAuthorSignature()) {
-            WrtLogW("URI attribute in Role tag does not "
+            LogWarning("URI attribute in Role tag does not "
               "match with signature filename.");
             return false;
         }
 
         if (roleURI != TOKEN_ROLE_DISTRIBUTOR_URI && !data.isAuthorSignature()) {
-            WrtLogW("URI attribute in Role tag does not "
+            LogWarning("URI attribute in Role tag does not "
               "match with signature filename.");
             return false;
         }
@@ -134,8 +134,8 @@ public:
 
     bool checkProfileURI(const SignatureData &data) {
         if (TOKEN_PROFILE_URI != data.getProfileURI()) {
-            WrtLogW(
-              "Profile tag contains unsupported value in URI attribute( %s ).", (data.getProfileURI()).c_str());
+            LogWarning(
+              "Profile tag contains unsupported value in URI attribute " << data.getProfileURI());
             return false;
         }
         return true;
@@ -146,7 +146,7 @@ public:
         ObjectList::const_iterator iter;
         for (iter = objectList.begin(); iter != objectList.end(); ++iter) {
             if (!data.containObjectReference(*iter)) {
-                WrtLogW("Signature does not contain reference for object %s", (*iter).c_str());
+                LogWarning("Signature does not contain reference for object " << *iter);
                 return false;
             }
         }
@@ -199,13 +199,13 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
 
     // First step - sort certificate
     if (!collection.sort()) {
-        WrtLogW("Certificates do not form valid chain.");
+        LogWarning("Certificates do not form valid chain.");
         return SignatureValidator::SIGNATURE_INVALID_CERT_CHAIN;//SIGNATURE_INVALID;
     }
 
     // Check for error
     if (collection.empty()) {
-        WrtLogW("Certificate list in signature is empty.");
+        LogWarning("Certificate list in signature is empty.");
         return SignatureValidator::SIGNATURE_INVALID_CERT_CHAIN;//SIGNATURE_INVALID;
     }
 
@@ -221,33 +221,33 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
     // Is Root CA certificate trusted?
     CertStoreId::Set storeIdSet = createCertificateIdentifier().find(root);
 
-    WrtLogD("Is root certificate from TIZEN_DEVELOPER domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER));
-    WrtLogD("Is root certificate from TIZEN_TEST domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_TEST));
-    WrtLogD("Is root certificate from TIZEN_VERIFY domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_VERIFY));
-    WrtLogD("Is root certificate from TIZEN_STORE domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_STORE));
-    WrtLogD("Is root certificate from TIZEN_PUBLIC domain:  %d", storeIdSet.contains(CertStoreId::VIS_PUBLIC));
-    WrtLogD("Is root certificate from TIZEN_PARTNER domain:  %d", storeIdSet.contains(CertStoreId::VIS_PARTNER));
-    WrtLogD("Is root certificate from TIZEN_PLATFORM domain:  %d", storeIdSet.contains(CertStoreId::VIS_PLATFORM));
+    LogDebug("Is root certificate from TIZEN_DEVELOPER domain : " << storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER));
+    LogDebug("Is root certificate from TIZEN_TEST domain      : " << storeIdSet.contains(CertStoreId::TIZEN_TEST));
+    LogDebug("Is root certificate from TIZEN_VERIFY domain    : " << storeIdSet.contains(CertStoreId::TIZEN_VERIFY));
+    LogDebug("Is root certificate from TIZEN_STORE domain     : " << storeIdSet.contains(CertStoreId::TIZEN_STORE));
+    LogDebug("Is root certificate from TIZEN_PUBLIC domain    : " << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Is root certificate from TIZEN_PARTNER domain   : " << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Is root certificate from TIZEN_PLATFORM domain  : " << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
-    WrtLogD("Visibility level is public :  %d", storeIdSet.contains(CertStoreId::VIS_PUBLIC));
-    WrtLogD("Visibility level is partner :  %d", storeIdSet.contains(CertStoreId::VIS_PARTNER));
-    WrtLogD("Visibility level is platform :  %d", storeIdSet.contains(CertStoreId::VIS_PLATFORM));
+    LogDebug("Visibility level is public   : " << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Visibility level is partner  : " << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Visibility level is platform : " << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
        if (data.isAuthorSignature())
        {
                if (!storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER))
                {
-                       WrtLogW("author-signature.xml has got unrecognized Root CA "
+                       LogWarning("author-signature.xml has got unrecognized Root CA "
                                        "certificate. Signature will be disregarded.");
                        disregard = true;
                }
    }
    else
    {
-               WrtLogD("signaturefile name = %s", data.getSignatureFileName().c_str());
+               LogDebug("signaturefile name = " << data.getSignatureFileName());
                if (storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER))
                {
-                       WrtLogE("distributor has author level siganture! Signature will be disregarded.");
+                       LogError("distributor has author level siganture! Signature will be disregarded.");
                        return SignatureValidator::SIGNATURE_IN_DISTRIBUTOR_CASE_AUTHOR_CERT;//SIGNATURE_INVALID;
                }
 
@@ -256,11 +256,11 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
       {
          if (storeIdSet.contains(CertStoreId::VIS_PUBLIC) || storeIdSet.contains(CertStoreId::VIS_PARTNER) || storeIdSet.contains(CertStoreId::VIS_PLATFORM))
          {
-            WrtLogD("Root CA for signature1.xml is correct.");
+            LogDebug("Root CA for signature1.xml is correct.");
          }
          else
          {
-            WrtLogW("signature1.xml has got unrecognized Root CA "
+            LogWarning("signature1.xml has got unrecognized Root CA "
                        "certificate. Signature will be disregarded.");
             disregard = true;
          }
@@ -280,7 +280,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
     // If the end certificate is not ROOT CA we should disregard signature
     // but still signature must be valid... Aaaaaa it's so stupid...
     if (!(root->isSignedBy(root))) {
-        WrtLogW("Root CA certificate not found. Chain is incomplete.");
+        LogWarning("Root CA certificate not found. Chain is incomplete.");
     //  context.allowBrokenChain = true;
     }
 
@@ -305,22 +305,22 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
       memset(&tc, 0, sizeof(tc));
 
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", t->tm_year + 1900, t->tm_mon + 1,t->tm_mday );
-      WrtLogD("## System's currentTime : %s", msg);
+      LogDebug("## System's currentTime : " << msg);
       fprintf(stderr, "## System's currentTime : %s\n", msg);
 
       tb = _ASN1_GetTimeT(notBeforeTime);
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", tb.tm_year + 1900, tb.tm_mon + 1,tb.tm_mday );
-      WrtLogD("## certificate's notBeforeTime : %s", msg);
+      LogDebug("## certificate's notBeforeTime : " << msg);
       fprintf(stderr, "## certificate's notBeforeTime : %s\n", msg);
 
       ta = _ASN1_GetTimeT(notAfterTime);
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", ta.tm_year + 1900, ta.tm_mon + 1,ta.tm_mday );
-      WrtLogD("## certificate's notAfterTime : %s", msg);
+      LogDebug("## certificate's notAfterTime : " << msg);
       fprintf(stderr, "## certificate's notAfterTime : %s\n", msg);
 
       if (storeIdSet.contains(CertStoreId::TIZEN_TEST) || storeIdSet.contains(CertStoreId::TIZEN_VERIFY))
       {
-        WrtLogD("## TIZEN_VERIFY : check certificate Time : FALSE");
+        LogDebug("## TIZEN_VERIFY : check certificate Time : FALSE");
         fprintf(stderr, "## TIZEN_VERIFY : check certificate Time : FALSE\n");
          return SignatureValidator::SIGNATURE_INVALID_CERT_TIME;//SIGNATURE_INVALID;
       }
@@ -361,7 +361,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
       }
 
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", tc.tm_year + 1900, tc.tm_mon + 1,tc.tm_mday );
-      WrtLogD("## cmp cert with validation time : %s", msg);
+      LogDebug("## cmp cert with validation time : " << msg);
       fprintf(stderr, "## cmp cert with validation time : %s\n", msg);
 
       time_t outCurrent = mktime(&tc);
@@ -386,30 +386,21 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
        if (notAfter < nowTime)
        {
           context.validationTime = notAfter - TIMET_DAY;
-          WrtLogW("Author certificate is expired. notAfter...");
+          LogWarning("Author certificate is expired. notAfter...");
        }
        */
 
        if (notBefore > nowTime)
        {
-          WrtLogW("Author certificate is expired. notBefore time is greater than system-time.");
+          LogWarning("Author certificate is expired. notBefore time is greater than system-time.");
 
           t = localtime(&nowTime);
-          WrtLogD("System's current Year : %d", (t->tm_year + 1900));
-          WrtLogD("System's current month : %d", (t->tm_mon + 1));
-          WrtLogD("System's current day : %d", (t->tm_mday));
 
           t = localtime(&notBefore);
-          WrtLogD("Author certificate's notBefore Year : %d", (t->tm_year + 1900));
-          WrtLogD("Author certificate's notBefore month : %d", (t->tm_mon + 1));
-          WrtLogD("Author certificate's notBefore day : %d", (t->tm_mday));
 
           context.validationTime = notBefore + TIMET_DAY;
 
           t = localtime(&context.validationTime);
-          WrtLogD("Modified current Year : %d", (t->tm_year + 1900));
-          WrtLogD("Modified current notBefore month : %d", (t->tm_mon + 1));
-          WrtLogD("Modified current notBefore day : %d", (t->tm_mday));
       }
     }
 #endif
@@ -421,13 +412,13 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
        if (!data.isAuthorSignature())
        {
                if (XmlSec::NO_ERROR != XmlSecSingleton::Instance().validate(&context)) {
-                       WrtLogW("Installation break - invalid package!");
+                       LogWarning("Installation break - invalid package!");
                        return SignatureValidator::SIGNATURE_INVALID_HASH_SIGNATURE;//SIGNATURE_INVALID;
                }
 
                data.setReference(context.referenceSet);
                if (!checkObjectReferences(data)) {
-                       WrtLogW("Failed to check Object References");
+                       LogWarning("Failed to check Object References");
                        return SignatureValidator::SIGNATURE_INVALID_HASH_SIGNATURE;//SIGNATURE_INVALID;
                }
 
@@ -435,7 +426,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
   /*
     ReferenceValidator fileValidator(widgetContentPath);
     if (ReferenceValidator::NO_ERROR != fileValidator.checkReferences(data)) {
-        WrtLogW("Invalid package - file references broken");
+        LogWarning("Invalid package - file references broken");
                return SignatureValidator::SIGNATURE_INVALID_NO_HASH_FILE;//SIGNATURE_INVALID;
     }
  */
@@ -451,7 +442,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
         coll.load(sortedCertificateList);
 
         if (!coll.sort()) {
-            WrtLogD("Collection does not contain chain!");
+            LogDebug("Collection does not contain chain!");
             return SignatureValidator::SIGNATURE_INVALID_CERT_CHAIN;//SIGNATURE_INVALID;
         }
 
@@ -473,7 +464,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::check(
 #endif
 
     if (disregard) {
-        WrtLogW("Signature is disregard. RootCA is not a member of Tizen");
+        LogWarning("Signature is disregard. RootCA is not a member of Tizen");
         return SignatureValidator::SIGNATURE_INVALID_DISTRIBUTOR_CERT;//SIGNATURE_DISREGARD;
     }
     return SignatureValidator::SIGNATURE_VERIFIED;
@@ -484,7 +475,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
             const std::list<std::string>& uriList)
 {
     if(uriList.size() == 0 )
-       WrtLogW("checkList >> no hash");
+       LogWarning("checkList >> no hash");
 
     bool disregard = false;
    
@@ -503,13 +494,13 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
 
     // First step - sort certificate
     if (!collection.sort()) {
-        WrtLogW("Certificates do not form valid chain.");
+        LogWarning("Certificates do not form valid chain.");
         return SignatureValidator::SIGNATURE_INVALID;
     }
 
     // Check for error
     if (collection.empty()) {
-        WrtLogW("Certificate list in signature is empty.");
+        LogWarning("Certificate list in signature is empty.");
         return SignatureValidator::SIGNATURE_INVALID;
     }
 
@@ -525,40 +516,40 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
     // Is Root CA certificate trusted?
     CertStoreId::Set storeIdSet = createCertificateIdentifier().find(root);
 
-    WrtLogD("Is root certificate from TIZEN_DEVELOPER domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER));
-    WrtLogD("Is root certificate from TIZEN_TEST domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_TEST));
-    WrtLogD("Is root certificate from TIZEN_VERIFY domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_VERIFY));
-    WrtLogD("Is root certificate from TIZEN_PUBLIC domain:  %d", storeIdSet.contains(CertStoreId::VIS_PUBLIC));
-    WrtLogD("Is root certificate from TIZEN_PARTNER domain:  %d", storeIdSet.contains(CertStoreId::VIS_PARTNER));
-    WrtLogD("Is root certificate from TIZEN_PLATFORM domain:  %d", storeIdSet.contains(CertStoreId::VIS_PLATFORM));
+    LogDebug("Is root certificate from TIZEN_DEVELOPER domain : " << storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER));
+    LogDebug("Is root certificate from TIZEN_TEST domain      : " << storeIdSet.contains(CertStoreId::TIZEN_TEST));
+    LogDebug("Is root certificate from TIZEN_VERIFY domain    : " << storeIdSet.contains(CertStoreId::TIZEN_VERIFY));
+    LogDebug("Is root certificate from TIZEN_PUBLIC domain    : " << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Is root certificate from TIZEN_PARTNER domain   : " << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Is root certificate from TIZEN_PLATFORM domain  : " << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
-    WrtLogD("Visibility level is public :  %d", storeIdSet.contains(CertStoreId::VIS_PUBLIC));
-    WrtLogD("Visibility level is partner :  %d", storeIdSet.contains(CertStoreId::VIS_PARTNER));
-    WrtLogD("Visibility level is platform :  %d", storeIdSet.contains(CertStoreId::VIS_PLATFORM));
+    LogDebug("Visibility level is public   : " << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Visibility level is partner  : " << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Visibility level is platform : " << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
     if (data.isAuthorSignature())
     {
      if (!storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER))
      {
-            WrtLogW("author-signature.xml has got unrecognized Root CA "
+            LogWarning("author-signature.xml has got unrecognized Root CA "
                        "certificate. Signature will be disregarded.");
             disregard = true;
      }
-      WrtLogD("Root CA for author signature is correct.");
+      LogDebug("Root CA for author signature is correct.");
    }
    else
    {
-       WrtLogD("signaturefile name = %s", data.getSignatureFileName().c_str());
+       LogDebug("signaturefile name = " << data.getSignatureFileName());
 
       if (data.getSignatureNumber() == 1)
       {
          if (storeIdSet.contains(CertStoreId::VIS_PUBLIC) || storeIdSet.contains(CertStoreId::VIS_PARTNER) || storeIdSet.contains(CertStoreId::VIS_PLATFORM))
          {
-            WrtLogD("Root CA for signature1.xml is correct.");
+            LogDebug("Root CA for signature1.xml is correct.");
          }
          else
          {
-            WrtLogW("signature1.xml has got unrecognized Root CA "
+            LogWarning("signature1.xml has got unrecognized Root CA "
                        "certificate. Signature will be disregarded.");
             disregard = true;
          }
@@ -578,7 +569,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
     // If the end certificate is not ROOT CA we should disregard signature
     // but still signature must be valid... Aaaaaa it's so stupid...
     if (!(root->isSignedBy(root))) {
-        WrtLogW("Root CA certificate not found. Chain is incomplete.");
+        LogWarning("Root CA certificate not found. Chain is incomplete.");
     //  context.allowBrokenChain = true;
     }
 
@@ -606,22 +597,22 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
       memset(&tc, 0, sizeof(tc));
 
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", t->tm_year + 1900, t->tm_mon + 1,t->tm_mday );
-      WrtLogD("## System's currentTime : %s", msg);
+      LogDebug("## System's currentTime : " << msg);
       fprintf(stderr, "## System's currentTime : %s\n", msg);
 
       tb = _ASN1_GetTimeT(notBeforeTime);
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", tb.tm_year + 1900, tb.tm_mon + 1,tb.tm_mday );
-      WrtLogD("## certificate's notBeforeTime : %s", msg);
+      LogDebug("## certificate's notBeforeTime : " << msg);
       fprintf(stderr, "## certificate's notBeforeTime : %s\n", msg);
 
       ta = _ASN1_GetTimeT(notAfterTime);
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", ta.tm_year + 1900, ta.tm_mon + 1,ta.tm_mday );
-      WrtLogD("## certificate's notAfterTime : %s", msg);
+      LogDebug("## certificate's notAfterTime : " << msg);
       fprintf(stderr, "## certificate's notAfterTime : %s\n", msg);
 
       if (storeIdSet.contains(CertStoreId::TIZEN_VERIFY))
       {
-         WrtLogD("## TIZEN_VERIFY : check certificate Time : FALSE");
+         LogDebug("## TIZEN_VERIFY : check certificate Time : FALSE");
          fprintf(stderr, "## TIZEN_VERIFY : check certificate Time : FALSE\n");
          return SignatureValidator::SIGNATURE_INVALID;
       }
@@ -632,7 +623,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
       tc.tm_mday = (tb.tm_mday + ta.tm_mday)/2;
 
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", tc.tm_year + 1900, tc.tm_mon + 1,tc.tm_mday );
-      WrtLogD("## cmp cert with validation time : %s", msg);
+      LogDebug("## cmp cert with validation time : " << msg);
       fprintf(stderr, "## cmp cert with validation time : %s\n", msg);
 
       time_t outCurrent = mktime(&tc);
@@ -655,30 +646,21 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
        if (notAfter < nowTime)
        {
           context.validationTime = notAfter - TIMET_DAY;
-          WrtLogW("Author certificate is expired. notAfter...");
+          LogWarning("Author certificate is expired. notAfter...");
        }
        */
 
        if (notBefore > nowTime)
        {
-          WrtLogW("Author certificate is expired. notBefore time is greater than system-time.");
+          LogWarning("Author certificate is expired. notBefore time is greater than system-time.");
 
           t = localtime(&nowTime);
-          WrtLogD("System's current Year : %d", (t->tm_year + 1900));
-          WrtLogD("System's current month : %d", (t->tm_mon + 1));
-          WrtLogD("System's current day : %d", (t->tm_mday));
 
           t = localtime(&notBefore);
-          WrtLogD("Author certificate's notBefore Year : %d", (t->tm_year + 1900));
-          WrtLogD("Author certificate's notBefore month : %d", (t->tm_mon + 1));
-          WrtLogD("Author certificate's notBefore day : %d", (t->tm_mday));
 
           context.validationTime = notBefore + TIMET_DAY;
 
           t = localtime(&context.validationTime);
-          WrtLogD("Modified current Year : %d", (t->tm_year + 1900));
-          WrtLogD("Modified current notBefore month : %d", (t->tm_mon + 1));
-          WrtLogD("Modified current notBefore day : %d", (t->tm_mday));
       }
     }
 #endif
@@ -689,7 +671,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
    if(uriList.size() == 0)
    {
      if (XmlSec::NO_ERROR != XmlSecSingleton::Instance().validateNoHash(&context)) {
-        WrtLogW("Installation break - invalid package! >> validateNoHash");
+        LogWarning("Installation break - invalid package! >> validateNoHash");
         return SignatureValidator::SIGNATURE_INVALID;
      }
    }
@@ -697,7 +679,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
    {
      XmlSecSingleton::Instance().setPartialHashList(uriList);
      if (XmlSec::NO_ERROR != XmlSecSingleton::Instance().validatePartialHash(&context)) {
-         WrtLogW("Installation break - invalid package! >> validatePartialHash");
+         LogWarning("Installation break - invalid package! >> validatePartialHash");
          return SignatureValidator::SIGNATURE_INVALID;
      }
    }
@@ -711,7 +693,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
   /*
     ReferenceValidator fileValidator(widgetContentPath);
     if (ReferenceValidator::NO_ERROR != fileValidator.checkReferences(data)) {
-        WrtLogW("Invalid package - file references broken");
+        LogWarning("Invalid package - file references broken");
         return SignatureValidator::SIGNATURE_INVALID;
     }
  */
@@ -726,7 +708,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
         coll.load(sortedCertificateList);
 
         if (!coll.sort()) {
-            WrtLogD("Collection does not contain chain!");
+            LogDebug("Collection does not contain chain!");
             return SignatureValidator::SIGNATURE_INVALID;
         }
 
@@ -748,7 +730,7 @@ SignatureValidator::Result ImplTizenSignatureValidator::checkList(SignatureData
 #endif
 
     if (disregard) {
-        WrtLogW("Signature is disregard. RootCA is not a member of Tizen.");
+        LogWarning("Signature is disregard. RootCA is not a member of Tizen.");
         return SignatureValidator::SIGNATURE_DISREGARD;
     }
     return SignatureValidator::SIGNATURE_VERIFIED;
@@ -803,13 +785,13 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
 
     // First step - sort certificate
     if (!collection.sort()) {
-        WrtLogW("Certificates do not form valid chain.");
+        LogWarning("Certificates do not form valid chain.");
         return SignatureValidator::SIGNATURE_INVALID;
     }
 
     // Check for error
     if (collection.empty()) {
-        WrtLogW("Certificate list in signature is empty.");
+        LogWarning("Certificate list in signature is empty.");
         return SignatureValidator::SIGNATURE_INVALID;
     }
 
@@ -825,30 +807,30 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
     // Is Root CA certificate trusted?
     CertStoreId::Set storeIdSet = createCertificateIdentifier().find(root);
 
-    WrtLogD("Is root certificate from TIZEN_DEVELOPER domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER));
-    WrtLogD("Is root certificate from TIZEN_TEST domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_TEST));
-    WrtLogD("Is root certificate from TIZEN_VERIFY domain:  %d", storeIdSet.contains(CertStoreId::TIZEN_VERIFY));
-    WrtLogD("Is root certificate from TIZEN_PUBLIC domain:  %d", storeIdSet.contains(CertStoreId::VIS_PUBLIC));
-    WrtLogD("Is root certificate from TIZEN_PARTNER domain:  %d", storeIdSet.contains(CertStoreId::VIS_PARTNER));
-    WrtLogD("Is root certificate from TIZEN_PLATFORM domain:  %d", storeIdSet.contains(CertStoreId::VIS_PLATFORM));
+    LogDebug("Is root certificate from TIZEN_DEVELOPER domain : " << storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER));
+    LogDebug("Is root certificate from TIZEN_TEST domain      : " << storeIdSet.contains(CertStoreId::TIZEN_TEST));
+    LogDebug("Is root certificate from TIZEN_VERIFY domain    : " << storeIdSet.contains(CertStoreId::TIZEN_VERIFY));
+    LogDebug("Is root certificate from TIZEN_PUBLIC domain    : " << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Is root certificate from TIZEN_PARTNER domain   : " << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Is root certificate from TIZEN_PLATFORM domain  : " << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
-    WrtLogD("Visibility level is public :  %d", storeIdSet.contains(CertStoreId::VIS_PUBLIC));
-    WrtLogD("Visibility level is partner :  %d", storeIdSet.contains(CertStoreId::VIS_PARTNER));
-    WrtLogD("Visibility level is platform :  %d", storeIdSet.contains(CertStoreId::VIS_PLATFORM));
+    LogDebug("Visibility level is public   : " << storeIdSet.contains(CertStoreId::VIS_PUBLIC));
+    LogDebug("Visibility level is partner  : " << storeIdSet.contains(CertStoreId::VIS_PARTNER));
+    LogDebug("Visibility level is platform : " << storeIdSet.contains(CertStoreId::VIS_PLATFORM));
 
        if (data.isAuthorSignature())
        {
                if (!storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER))
                {
-                       WrtLogW("author-signature.xml has got unrecognized Root CA "
+                       LogWarning("author-signature.xml has got unrecognized Root CA "
                                        "certificate. Signature will be disregarded.");
                        disregard = true;
                }
        } else {
-        WrtLogD("signaturefile name = %s", data.getSignatureFileName().c_str());
+        LogDebug("signaturefile name = " << data.getSignatureFileName());
                if (storeIdSet.contains(CertStoreId::TIZEN_DEVELOPER))
                {
-                       WrtLogE("distributor has author level siganture! Signature will be disregarded.");
+                       LogError("distributor has author level siganture! Signature will be disregarded.");
                        return SignatureValidator::SIGNATURE_INVALID;
                }
 
@@ -857,11 +839,11 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
        {
           if (storeIdSet.contains(CertStoreId::VIS_PUBLIC) || storeIdSet.contains(CertStoreId::VIS_PARTNER) || storeIdSet.contains(CertStoreId::VIS_PLATFORM))
           {
-             WrtLogD("Root CA for signature1.xml is correct.");
+             LogDebug("Root CA for signature1.xml is correct.");
           }
           else
           {
-          WrtLogW("signature1.xml has got unrecognized Root CA "
+          LogWarning("signature1.xml has got unrecognized Root CA "
                         "certificate. Signature will be disregarded.");
              disregard = true;
           }
@@ -881,7 +863,7 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
     // If the end certificate is not ROOT CA we should disregard signature
     // but still signature must be valid... Aaaaaa it's so stupid...
     if (!(root->isSignedBy(root))) {
-        WrtLogW("Root CA certificate not found. Chain is incomplete.");
+        LogWarning("Root CA certificate not found. Chain is incomplete.");
 //        context.allowBrokenChain = true;
     }
 
@@ -907,22 +889,22 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
       memset(&tc, 0, sizeof(tc));
 
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", t->tm_year + 1900, t->tm_mon + 1,t->tm_mday );
-      WrtLogD("## System's currentTime : %s", msg);
+      LogDebug("## System's currentTime : " << msg);
       fprintf(stderr, "## System's currentTime : %s\n", msg);
 
       tb = _ASN1_GetTimeT(notBeforeTime);
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", tb.tm_year + 1900, tb.tm_mon + 1,tb.tm_mday );
-      WrtLogD("## certificate's notBeforeTime : %s",  msg);
+      LogDebug("## certificate's notBeforeTime : " <<  msg);
       fprintf(stderr, "## certificate's notBeforeTime : %s\n", msg);
 
       ta = _ASN1_GetTimeT(notAfterTime);
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", ta.tm_year + 1900, ta.tm_mon + 1,ta.tm_mday );
-      WrtLogD("## certificate's notAfterTime : %s", msg);
+      LogDebug("## certificate's notAfterTime : " << msg);
       fprintf(stderr, "## certificate's notAfterTime : %s\n", msg);
 
       if (storeIdSet.contains(CertStoreId::TIZEN_VERIFY))
       {
-         WrtLogD("## TIZEN_VERIFY : check certificate Time : FALSE");
+         LogDebug("## TIZEN_VERIFY : check certificate Time : FALSE");
          fprintf(stderr, "## TIZEN_VERIFY : check certificate Time : FALSE\n");
          return SignatureValidator::SIGNATURE_INVALID;
       }
@@ -933,7 +915,7 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
       tc.tm_mday = (tb.tm_mday + ta.tm_mday)/2;
 
       snprintf(msg, sizeof(msg), "Year: %d, month: %d, day : %d", tc.tm_year + 1900, tc.tm_mon + 1,tc.tm_mday );
-      WrtLogD("## cmp cert with validation time : %s", msg);
+      LogDebug("## cmp cert with validation time : " << msg);
       fprintf(stderr, "## cmp cert with validation time : %s\n", msg);
 
       time_t outCurrent = mktime(&tc);
@@ -956,37 +938,28 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
       if (notAfter < nowTime)
       {
          context.validationTime = notAfter - TIMET_DAY;
-         WrtLogW("Author certificate is expired. notAfter...");
+         LogWarning("Author certificate is expired. notAfter...");
       }
       */
 
     if (notBefore > nowTime)
     {
-       WrtLogW("Author certificate is expired. notBefore time is greater than system-time.");
+       LogWarning("Author certificate is expired. notBefore time is greater than system-time.");
 
        t = localtime(&nowTime);
-       WrtLogD("System's current Year : %d", (t->tm_year + 1900));
-       WrtLogD("System's current month : %d", (t->tm_mon + 1));
-       WrtLogD("System's current day : %d", (t->tm_mday));
 
        t = localtime(&notBefore);
-       WrtLogD("Author certificate's notBefore Year : %d", (t->tm_year + 1900));
-       WrtLogD("Author certificate's notBefore month : %d", (t->tm_mon + 1));
-       WrtLogD("Author certificate's notBefore day : %d", (t->tm_mday));
 
        context.validationTime = notBefore + TIMET_DAY;
 
        t = localtime(&context.validationTime);
-       WrtLogD("Modified current Year : %d", (t->tm_year + 1900));
-       WrtLogD("Modified current notBefore month : %d", (t->tm_mon + 1));
-       WrtLogD("Modified current notBefore day : %d",  (t->tm_mday));
     }
    }
 #endif
        if (!data.isAuthorSignature())
        {
                if (XmlSec::NO_ERROR != XmlSecSingleton::Instance().validate(&context)) {
-                       WrtLogW("Installation break - invalid package!");
+                       LogWarning("Installation break - invalid package!");
                        return SignatureValidator::SIGNATURE_INVALID;
                }
 
@@ -998,7 +971,7 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
 
                ReferenceValidator fileValidator(widgetContentPath);
                if (ReferenceValidator::NO_ERROR != fileValidator.checkReferences(data)) {
-                       WrtLogW("Invalid package - file references broken");
+                       LogWarning("Invalid package - file references broken");
                        return SignatureValidator::SIGNATURE_INVALID;
                }
        }
@@ -1013,7 +986,7 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
         coll.load(sortedCertificateList);
 
         if (!coll.sort()) {
-            WrtLogD("Collection does not contain chain!");
+            LogDebug("Collection does not contain chain!");
             return SignatureValidator::SIGNATURE_INVALID;
         }
 
@@ -1035,7 +1008,7 @@ SignatureValidator::Result ImplWacSignatureValidator::check(
 #endif
 
     if (disregard) {
-        WrtLogW("Signature is disregard. RootCA is not a member of Tizen.");
+        LogWarning("Signature is disregard. RootCA is not a member of Tizen.");
         return SignatureValidator::SIGNATURE_DISREGARD;
     }
     return SignatureValidator::SIGNATURE_VERIFIED;
@@ -1050,7 +1023,7 @@ SignatureValidator::SignatureValidator(
     bool complianceMode)
   : m_impl(0)
 {
-    WrtLogD( "appType :%d", appType );
+    LogDebug( "appType : " << appType );
 
     if(appType == TIZEN)
     {