Fix logger usage according to KLAY API changed
[platform/core/security/ode.git] / server / engine / encryption / cryptsetup-engine.cpp
index d013d2f..9c35f48 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "cryptsetup-engine.h"
 #include "../../file-footer.h"
+#include "../../logger.h"
 
 #include <cctype>
 #include <algorithm>
@@ -23,7 +24,6 @@
 #include <libcryptsetup.h>
 
 #include <klay/exception.h>
-#include <klay/audit/logger.h>
 
 namespace ode {
 
@@ -52,17 +52,17 @@ void log(int level, const char *msg, void*)
        switch (level)
        {
        case CRYPT_LOG_ERROR:
-               ERROR("[libcryptsetup] " + msgStr);
+               ERROR(SINK, "[libcryptsetup] " + msgStr);
                break;
        case CRYPT_LOG_VERBOSE:
-               INFO("[libcryptsetup] " + msgStr);
+               INFO(SINK, "[libcryptsetup] " + msgStr);
                break;
        case CRYPT_LOG_DEBUG:
        case CRYPT_LOG_NORMAL:
-               DEBUG("[libcryptsetup] " + msgStr);
+               DEBUG(SINK, "[libcryptsetup] " + msgStr);
                break;
        default:
-               ERROR("[libcryptsetup] Unsupported log level. Msg: " + msgStr);
+               ERROR(SINK, "[libcryptsetup] Unsupported log level. Msg: " + msgStr);
        }
 }
 #endif
@@ -120,7 +120,7 @@ public:
        ~Device()
        {
                if (0 != crypt_memory_lock(device, 0))
-               ERROR("Failed to unlock memory");
+               ERROR(SINK, "Failed to unlock memory");
 
                crypt_free(device);
        }