Commit 67d8af4d authored by Dorian Guillois's avatar Dorian Guillois
Browse files

Update connector to use new clib logging api.

parent 379d65a9
......@@ -51,6 +51,7 @@ if (WITH_CENTREON_CLIB_INCLUDE_DIR)
message(FATAL_ERROR "Could not find Centreon Clib's headers in ${WITH_CENTREON_CLIB_INCLUDE_DIR}.")
endif ()
include_directories("${WITH_CENTREON_CLIB_INCLUDE_DIR}")
set(CLIB_INCLUDE_DIR "${WITH_CENTREON_CLIB_INCLUDE_DIR}")
elseif (CLIB_FOUND) # Was Centreon Clib detected with pkg-config ?
if (CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLIB_CFLAGS}")
......@@ -295,3 +296,6 @@ message(STATUS " - Prefix ${CMAKE_INSTALL_PREFIX}")
message(STATUS " - Binary prefix ${PREFIX_BINARY}")
message(STATUS " - Package ${PACKAGE_LIST}")
message(STATUS "")
message(STATUS " Libraries")
message(STATUS " - clib include directory ${CLIB_INCLUDE_DIR}")
message(STATUS " - clib library directory ${CLIB_LIBRARIES}")
......@@ -101,21 +101,21 @@ int main(int argc, char** argv, char** env) {
else {
// Set logging object.
if (opts.get_argument("debug").get_is_set()) {
logging::engine::instance().set_show_pid(true);
logging::engine::instance().set_show_thread_id(true);
log_file.show_pid(true);
log_file.show_thread_id(true);
logging::engine::instance().add(
&log_file,
(1ull << logging::type_debug)
| (1ull << logging::type_info)
| (1ull << logging::type_error),
logging::type_debug
| logging::type_info
| logging::type_error,
logging::high);
}
else {
logging::engine::instance().set_show_pid(false);
logging::engine::instance().set_show_thread_id(false);
log_file.show_pid(false);
log_file.show_thread_id(false);
logging::engine::instance().add(
&log_file,
(1ull << logging::type_info) | (1ull << logging::type_error),
logging::type_info | logging::type_error,
logging::low);
}
log_info(logging::low) << "Centreon Connector Perl "
......
......@@ -149,6 +149,7 @@ if (WITH_CENTREON_CLIB_INCLUDE_DIR)
message(FATAL_ERROR "Could not find Centreon Clib's headers in ${WITH_CENTREON_CLIB_INCLUDE_DIR}.")
endif ()
include_directories("${WITH_CENTREON_CLIB_INCLUDE_DIR}")
set(CLIB_INCLUDE_DIR "${WITH_CENTREON_CLIB_INCLUDE_DIR}")
elseif (CLIB_FOUND) # Was Centreon Clib detected with pkg-config ?
if (CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLIB_CFLAGS}")
......@@ -641,3 +642,6 @@ message(STATUS " - Prefix ${CMAKE_INSTALL_PREFIX}")
message(STATUS " - Binary prefix ${PREFIX_BINARY}")
message(STATUS " - Package ${PACKAGE_LIST}")
message(STATUS "")
message(STATUS " Libraries")
message(STATUS " - clib include directory ${CLIB_INCLUDE_DIR}")
message(STATUS " - clib library directory ${CLIB_LIBRARIES}")
......@@ -107,21 +107,21 @@ int main(int argc, char* argv[]) {
else {
// Set logging object.
if (opts.get_argument("debug").get_is_set()) {
logging::engine::instance().set_show_pid(true);
logging::engine::instance().set_show_thread_id(true);
log_file.show_pid(true);
log_file.show_thread_id(true);
logging::engine::instance().add(
&log_file,
(1ull << logging::type_debug)
| (1ull << logging::type_info)
| (1ull << logging::type_error),
logging::type_debug
| logging::type_info
| logging::type_error,
logging::high);
}
else {
logging::engine::instance().set_show_pid(false);
logging::engine::instance().set_show_thread_id(false);
log_file.show_pid(false);
log_file.show_thread_id(false);
logging::engine::instance().add(
&log_file,
(1ull << logging::type_info) | (1ull << logging::type_error),
logging::type_info | logging::type_error,
logging::low);
}
log_info(logging::low) << "Centreon Connector SSH "
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment