INCLUDE(CheckFunctionExists)
INCLUDE(CheckIncludeFiles)
-FIND_PACKAGE(Boost 1.54
- REQUIRED
- COMPONENTS
- log)
-
FIND_PACKAGE(PkgConfig REQUIRED)
-PKG_CHECK_MODULES(DLOG dlog)
+PKG_CHECK_MODULES(DLOG REQUIRED dlog)
#### Find mbedtls ####
###### Setup include paths and library directories #######
-ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
-
-IF(DLOG_FOUND)
- include_directories(${DLOG_INCLUDE_DIRS})
- link_directories(${DLOG_LIBRARY_DIRS})
- add_definitions(${DLOG_CFLAGS_OTHER})
- add_definitions(-DUSE_DLOG_LOGGING=1)
-ENDIF(DLOG_FOUND)
+include_directories(${DLOG_INCLUDE_DIRS})
+link_directories(${DLOG_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(device-certificate-manager)
###### Include and library directories ######
-IF(DLOG_FOUND)
- include_directories(${DLOG_INCLUDE_DIRS})
- link_directories(${DLOG_LIBRARY_DIRS})
- add_definitions(-DUSE_DLOG_LOGGING=1)
-ENDIF()
+include_directories(${DLOG_INCLUDE_DIRS})
+link_directories(${DLOG_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
../abstractcryptobackendcontext.cpp
dummycryptobackend.cpp
dummycryptobackendcontext.cpp
+ ../log.cpp
${CMAKE_CURRENT_BINARY_DIR}/rootCA_ecdsa_key.c
${CMAKE_CURRENT_BINARY_DIR}/rootCA_ecdsa_cert.c
${CMAKE_CURRENT_BINARY_DIR}/rootCA_rsa_key.c
${CMAKE_THREAD_LIBS_INIT}
${MBEDTLS_LIB}
${MBEDCRYPTO_LIB}
+ ${DLOG_LIBRARIES}
)
-IF(DLOG_FOUND)
- target_link_libraries(${DCM_BACKEND_API} ${DLOG_LIBRARIES})
-ENDIF()
-
###### Properties of library ######
set_property(TARGET ${DCM_BACKEND_API} PROPERTY DEFINE_SYMBOL DCM_BACKEND_API_DUMMY_EXPORT)
#include "dummycryptobackend.h"
#include "dummycryptobackendcontext.h"
-#include "logging.h"
+#include "log.h"
dummy_crypto_backend::dummy_crypto_backend() {
- BOOST_LOG_FUNCTION();
}
dummy_crypto_backend::~dummy_crypto_backend() {
- BOOST_LOG_FUNCTION();
}
#include <mbedtls/pk.h>
#include <mbedtls/ctr_drbg.h>
#include <iostream>
-#include "logging.h"
+#include "log.h"
extern "C" {
extern size_t dummy_rootca_rsa_key_size;
}
dummy_crypto_backend_context::dummy_crypto_backend_context(const std::string& keyType) {
- BOOST_LOG_FUNCTION();
if(keyType.empty() || keyType == "RSA") {
fKey = CRYPTO_KEY_TYPE_RSA;
} else if(keyType == "ECDSA") {
sizeof(dummy_crypto_backend_context) );
if(!ret) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Can't seed entropy source";
+ LOGE("Can't seed entropy source");
mbedtls_ctr_drbg_free( &fCtrDrbg );
mbedtls_entropy_free( &fEntropy );
throw std::runtime_error("seed failure");
}
dummy_crypto_backend_context::~dummy_crypto_backend_context() {
- BOOST_LOG_FUNCTION();
mbedtls_ctr_drbg_free( &fCtrDrbg );
mbedtls_entropy_free( &fEntropy );
}
int dummy_crypto_backend_context::request_certificate_chain(std::string& mutable_chain)
{
- BOOST_LOG_FUNCTION();
if(fKey == CRYPTO_KEY_TYPE_RSA) {
mutable_chain.assign(dummy_rootca_rsa_cert, dummy_rootca_rsa_cert_size);
} else {
const std::string& dataToSign,
std::string& digestResult)
{
- BOOST_LOG_FUNCTION();
int error;
mbedtls_pk_context pk;
}
if(error != 0) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Can't parse private key";
+ LOGE("Can't parse private key");
mbedtls_pk_free(&pk);
return error;
}
size_t sig_len = 0;
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Maximum digest size is " << MBEDTLS_MPI_MAX_SIZE;
+ LOGD("Maximum digest size is " << MBEDTLS_MPI_MAX_SIZE);
char* output = (char*)malloc(MBEDTLS_MPI_MAX_SIZE);
if (!output) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Can't allocate output buffer for signing";
+ LOGE("Can't allocate output buffer for signing");
error = -1;
mbedtls_pk_free(&pk);
return error;
&fCtrDrbg);
if(error != 0) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Signature generation failed";
+ LOGE("Signature generation failed");
} else {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Signature size is " << sig_len;
+ LOGD("Signature size is " << sig_len);
digestResult = std::string(output, sig_len);
}
unsigned int dummy_crypto_backend_context::key_length()
{
- BOOST_LOG_FUNCTION();
size_t keyLength = 0;
mbedtls_pk_context pk;
###### Include and library directories ######
-IF(DLOG_FOUND)
- include_directories(${DLOG_INCLUDE_DIRS})
- link_directories(${DLOG_LIBRARY_DIRS})
- add_definitions(-DUSE_DLOG_LOGGING=1)
-ENDIF()
+include_directories(${DLOG_INCLUDE_DIRS})
+link_directories(${DLOG_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
../abstractcryptobackendcontext.cpp
ksebackend.cpp
ksebackendcontext.cpp
+ ../log.cpp
)
###### Linking ######
${CMAKE_THREAD_LIBS_INIT}
${MBEDTLS_LIB}
${MBEDCRYPTO_LIB}
+ ${DLOG_LIBRARIES}
)
-IF(DLOG_FOUND)
- target_link_libraries(${DCM_BACKEND_API} ${DLOG_LIBRARIES})
-ENDIF()
-
###### Properties of library ######
set_property(TARGET ${DCM_BACKEND_API} PROPERTY DEFINE_SYMBOL DCM_BACKEND_API_SEE_EXPORT)
#include <cassert>
#include <set>
#include <list>
-#include "logging.h"
+#include "log.h"
int x509_crt_rewriter::parse(const unsigned char * buffer, size_t length)
{
- BOOST_LOG_FUNCTION();
return mbedtls_x509_crt_parse(fChain, buffer, length);
}
void x509_crt_rewriter::sort_chain()
{
- BOOST_LOG_FUNCTION();
-
// Only 1 certificate - don't bother
if(!fChain->next) {
fChainSize = fChain->raw.len;
std::string x509_crt_rewriter::emit_pem()
{
- BOOST_LOG_FUNCTION();
std::string buffer;
if(fChainSize == 0)
#include <stdbool.h>
#include <stdint.h>
#include <tizen.h>
-#include <dlog.h>
#define _IN_
#define _OUT_
#include "ksebackend.h"
#include "ksebackendcontext.h"
-#include "logging.h"
+#include "log.h"
#include <mutex>
#include "konaise.h"
fKseInitOK(false),
fSoResolver(std::string(KSE_LIB_NAME))
{
- BOOST_LOG_FUNCTION();
initialize_kse();
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Constructed KSE backend";
+ LOGD("Constructed KSE backend");
}
kse_backend::~kse_backend() {
- BOOST_LOG_FUNCTION();
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Destructed KSE backend";
+ LOGD("Destructed KSE backend");
}
void kse_backend::initialize_kse() {
if(fKseInitOK)
return;
- BOOST_LOG_FUNCTION();
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Initializing KSE backend";
+ LOGD("Initializing KSE backend");
std::unique_lock<std::mutex> locker(fKSEMutex);
if(!fSoResolver.ensure_loaded()) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "KSE framework init failure: Fail to load KSE library";
+ LOGE("KSE framework init failure: Fail to load KSE library");
fKseInitOK = false;
return;
}
******************************************************************/
#include "ksebackendcontext.h"
-#include "logging.h"
+#include "log.h"
#include "konaise.h"
#include "cert_utils.h"
kse_backend_context::kse_backend_context(std::shared_ptr<kse_backend> backend, const std::string& keyType) :
fBackendPtr(backend)
{
- BOOST_LOG_FUNCTION();
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug)
- << "Created new KSE with key " << keyType;
+ LOGD("Created new KSE with key " << keyType);
if(keyType.empty() || keyType == "ECDSA") {
fKeyType = CRYPTO_KEY_TYPE_ECDSA;
throw std::invalid_argument("Unsupported key type");
}
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug)
- << "Created new KSE context at " << this;
+ LOGD("Created new KSE context at " << this);
}
kse_backend_context::~kse_backend_context()
{
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug)
- << "Deleting KSE context " << this;
+ LOGD("Deleting KSE context " << this);
}
int kse_backend_context::get_certificate(unsigned int index, std::string& outcert)
auto backend = fBackendPtr.lock();
if(!backend) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error)
- << "Unable to acquire backend pointer";
+ LOGE("Unable to acquire backend pointer");
return -EINVAL;
}
error = resolver.invoke<int, unsigned int, hal_data *>(&kse_get_certificate_key,
method_name, index, &cert);
} catch(...) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error)
- << "KSE: Got exception when calling resolver.invoke";
+ LOGE("KSE: Got exception when calling resolver.invoke");
throw;
}
if(error != 0) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error)
- << "Failed to get certificate. error=" << error;
+ LOGE("Failed to get certificate. error=" << error);
return -EINVAL;
}
-#ifdef ENABLE_DEBUG_LOGGING
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug)
- << "KSE: Got certificate with " << cert.data_len
- << " bytes and index " << index;
-#endif
+ LOGD("KSE: Got certificate with " << cert.data_len << " bytes and index " << index);
try {
outcert.assign((const char *)cert.data, cert.data_len);
} catch(...) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error)
- << "KSE: Got exception when assigning data";
+ LOGE("KSE: Got exception when assigning data");
free(cert.data);
throw;
}
int kse_backend_context::request_certificate_chain(std::string& mutable_chain)
{
- BOOST_LOG_FUNCTION();
-#ifdef ENABLE_DEBUG_LOGGING
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug)
- << "KSE : Request certificate chain";
-#endif
+ LOGD("KSE : Request certificate chain");
std::string leaf_cert;
std::string subca_cert;
mutable_chain.append(cert_writer.emit_pem());
-#ifdef ENABLE_DEBUG_LOGGING
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug)
- << "Requested certificate in " << this;
-#endif
+ LOGD("Requested certificate in " << this);
return 0;
}
int kse_backend_context::sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
std::string& digestResult)
{
- BOOST_LOG_FUNCTION();
hal_data hashed_data = {NULL, 0, NULL};
hal_data signed_data = {NULL, 0, NULL};
hashed_data.data = (void *)dataToSign.c_str();
hashed_data.data_len = dataToSign.size();
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "KSE: Sign " << hashed_data.data_len << " bytes";
+ LOGD("KSE: Sign " << hashed_data.data_len << " bytes");
auto backend = fBackendPtr.lock();
if(!backend) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Unable to acquire backend pointer";
+ LOGE("Unable to acquire backend pointer");
return -EINVAL;
}
auto& resolver(backend->get_so_resolver());
-#ifdef ENABLE_DEBUG_LOGGING
try {
std::string hex;
boost::algorithm::hex((const unsigned char *)hashed_data.data,
(const unsigned char *)hashed_data.data + hashed_data.data_len,
std::back_inserter(hex));
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Hashed data is " << hex;
+ LOGD("Hashed data is " << hex);
} catch(...) {
}
-#endif
const char *method_name = "hal_ecdsa_sign_md";
hal_ecdsa_mode mode = {HAL_ECDSA_SEC_P256R1, _get_hal_hash_type(digestType)};
if(error != 0) {
char buffer[256];
mbedtls_strerror(error, buffer, sizeof(buffer));
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) <<
- "Unable to generate ECDSA signature in " <<
- this <<
- " (" << error << ") : " <<
- std::string(buffer);
+ LOGE("Unable to generate ECDSA signature in " << this << " (" << error << ") : " << std::string(buffer));
return MBEDTLS_ERR_PK_BAD_INPUT_DATA;
}
-#ifdef ENABLE_DEBUG_LOGGING
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Signature length is " << signed_data.data_len;
+ LOGD("Signature length is " << signed_data.data_len);
try {
std::string hex;
boost::algorithm::hex((const unsigned char *)signed_data.data,
(const unsigned char *)signed_data.data + signed_data.data_len,
std::back_inserter(hex));
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Hex signature is " << hex;
+ LOGD("Hex signature is " << hex);
} catch(...) {
}
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "KSE: Generated ECDSA signature";
-#endif
+ LOGD("KSE: Generated ECDSA signature");
digestResult.assign((const char *)signed_data.data, signed_data.data_len);
******************************************************************/
#include "soresolver.h"
-#include "logging.h"
+#include "log.h"
#include <dlfcn.h>
so_resolver::so_resolver(const std::string& libraryName) :
so_resolver::~so_resolver()
{
if(fLibraryHandle.load(std::memory_order_relaxed)) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Unloading library " << fLibraryName;
+ LOGD("Unloading library " << fLibraryName);
dlclose(fLibraryHandle.exchange(nullptr, std::memory_order_relaxed));
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Unloaded library " << fLibraryName;
+ LOGD("Unloaded library " << fLibraryName);
}
}
void * so_resolver::resolve_function(const int * key_ptr, const char * name) noexcept
{
- BOOST_LOG_FUNCTION();
-
std::unique_lock<std::mutex> locker(fCacheLock);
if(key_ptr) {
void * handle = fLibraryHandle.load(std::memory_order_relaxed);
if(handle) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Resolving symbol " << name << " from " << fLibraryName;
+ LOGD("Resolving symbol " << name << " from " << fLibraryName);
void * sym = dlsym(handle, name);
if(!sym) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Unable to resolve symbol " << name << " from " <<
- fLibraryName << ": Error is " << dlerror();
+ LOGE("Unable to resolve symbol " << name << " from " << fLibraryName << ": Error is " << dlerror());
} else {
try {
if(key_ptr) {
fCache.emplace(key_ptr, sym);
}
} catch(...) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Problem with updating symbol cache!!";
+ LOGE("Problem with updating symbol cache!!");
sym = nullptr;
}
}
return sym;
}
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Trying to resolve symbol " << name << " from not loaded library " << fLibraryName;
+ LOGE("Trying to resolve symbol " << name << " from not loaded library " << fLibraryName);
return nullptr;
}
bool so_resolver::ensure_loaded() noexcept
{
- BOOST_LOG_FUNCTION();
-
std::unique_lock<std::mutex> locker(fCacheLock);
void * handle = fLibraryHandle.load(std::memory_order_acquire);
if(handle)
return true;
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Loading library " << fLibraryName;
+ LOGD("Loading library " << fLibraryName);
handle = dlopen(fLibraryName.c_str(), RTLD_LAZY | RTLD_LOCAL);
if(!handle) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Unable to load library " << fLibraryName << ": " << dlerror();
+ LOGE("Unable to load library " << fLibraryName << ": " << dlerror());
return false;
}
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::debug) << "Library loaded " << fLibraryName;
+ LOGD("Library loaded " << fLibraryName);
void * expectedValue = nullptr;
#######################################################################################
# For SE_KONAI
-ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_executable(dcm_konaise_tool
../soresolver.cpp
+ ../../log.cpp
konaise_tool.cpp)
target_link_libraries(dcm_konaise_tool
- ${Boost_LOG_LIBRARY}
${Boost_SYSTEM_LIBRARY}
dl
${CMAKE_THREAD_LIBS_INIT}
+ ${DLOG_LIBRARIES}
)
install(TARGETS dcm_konaise_tool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
--- /dev/null
+/******************************************************************
+ *
+ * Copyright 2020 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+#include <dlog.h>
+#include <syslog.h>
+
+#ifdef NDEBUG
+int __log_level = LOG_ERR;
+#else
+int __log_level = LOG_DEBUG;
+#endif
+
+#define DCM_LOG_TAG "DEVICE_CERTIFICATE_MANAGER_BACKEND"
+
+void dcm_print(int priority, char const *fmt, ...)
+{
+ log_priority dlog_prio;
+
+ switch (priority) {
+ case LOG_EMERG:
+ dlog_prio = DLOG_FATAL;
+ break;
+ case LOG_ERR:
+ dlog_prio = DLOG_ERROR;
+ break;
+ case LOG_WARNING:
+ dlog_prio = DLOG_WARN;
+ break;
+ case LOG_INFO:
+ dlog_prio = DLOG_INFO;
+ break;
+ case LOG_DEBUG:
+ dlog_prio = DLOG_DEBUG;
+ break;
+ default:
+ dlog_prio = DLOG_DEFAULT;
+ }
+
+ va_list ap;
+ va_start(ap, fmt);
+ (void) vprint_system_log(dlog_prio, DCM_LOG_TAG, fmt, ap);
+ va_end(ap);
+}
--- /dev/null
+/******************************************************************
+ *
+ * Copyright 2020 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+#ifndef SHARED_LOG_H_
+#define SHARED_LOG_H_
+
+#include <stdlib.h>
+#include <syslog.h>
+#include <sstream>
+
+#define UNUSED __attribute__((unused))
+
+extern int __log_level;
+extern void dcm_print(int priority, char const *fmt, ...);
+
+namespace {
+ template <typename ...Args>
+ void UNUSED __LOG_FUN(int level, const std::stringstream &format, Args&&... args) {
+ dcm_print(level, format.str().c_str(), std::forward<Args>(args)...);
+ }
+
+ template <>
+ void UNUSED __LOG_FUN(int level, const std::stringstream &format) {
+ dcm_print(level, "%s", format.str().c_str());
+ }
+
+ template <typename ...Args>
+ void UNUSED __LOG_FUN(int level, const char *format, Args&&... args) {
+ dcm_print(level, format, std::forward<Args>(args)...);
+ }
+
+ template <>
+ void UNUSED __LOG_FUN(int level, const char *format) {
+ dcm_print(level, "%s", format);
+ }
+
+} // namespace anonymous
+
+#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
+
+#define __LOG(LEVEL, FORMAT, ...) \
+ do { \
+ if (LEVEL <= __log_level) { \
+ std::stringstream __LOG_FORMAT; \
+ __LOG_FORMAT << __FILENAME__ << ": " << __func__ << "(" << __LINE__ << ") > " << FORMAT; \
+ __LOG_FUN(LEVEL, __LOG_FORMAT, ##__VA_ARGS__); \
+ } \
+ } while (0)
+
+#define LOGM(...) __LOG(LOG_EMERG, __VA_ARGS__) /* system is unusable */
+#define LOGE(...) __LOG(LOG_ERR, __VA_ARGS__) /* error conditions */
+#define LOGW(...) __LOG(LOG_WARNING, __VA_ARGS__) /* warning conditions */
+#define LOGI(...) __LOG(LOG_INFO, __VA_ARGS__) /* informational */
+#define LOGD(...) __LOG(LOG_DEBUG, __VA_ARGS__) /* debug-level messages */
+
+#endif /* SHARED_LOG_H_ */
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#ifndef LOGGING_H_
-#define LOGGING_H_
-
-#include <boost/log/common.hpp>
-#include <boost/log/expressions.hpp>
-#include <boost/log/attributes.hpp>
-#include <boost/log/sinks/sync_frontend.hpp>
-#include <boost/log/sinks/syslog_backend.hpp>
-#include <boost/log/sources/logger.hpp>
-#include <boost/log/utility/setup/console.hpp>
-#include <boost/log/utility/setup/common_attributes.hpp>
-#include <boost/log/attributes/timer.hpp>
-#include <boost/log/attributes/named_scope.hpp>
-
-#ifdef USE_DLOG_LOGGING
-#define LOG_TAG "DEVICE_CERTIFICATE_MANAGER_SERVER"
-#include <dlog.h>
-#endif
-
-enum class log_severity {
- debug,
- normal,
- warning,
- error
-};
-
-// Global logger declaration
-BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(dcm_logger, boost::log::sources::severity_logger_mt<log_severity>)
-
-#if defined(NDEBUG) && !defined(DEBUG)
-#else
-#define ENABLE_DEBUG_LOGGING 1
-#endif
-
-#endif /* LOGGING_H_ */