Skip to content

Commit

Permalink
Make it possible to use own logger instead of everest logger. (#150)
Browse files Browse the repository at this point in the history
* Make it possible to use own logger instead of everest logger.

Signed-off-by: Maaike Zijderveld, Alfen <[email protected]>

* formatting

Signed-off-by: Maaike Zijderveld, Alfen <[email protected]>

---------

Signed-off-by: Maaike Zijderveld, Alfen <[email protected]>
Co-authored-by: Patrick van Bennekom <[email protected]>
  • Loading branch information
maaikez and PatrickvBa authored Aug 24, 2023
1 parent 6cfe002 commit fc610b5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/ocpp/common/charging_station_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#ifndef OCPP_COMMON_CHARGE_POINT_HPP
#define OCPP_COMMON_CHARGE_POINT_HPP

#include <boost/shared_ptr.hpp>

#include <ocpp/common/message_queue.hpp>
#include <ocpp/common/pki_handler.hpp>
#include <ocpp/common/websocket/websocket.hpp>
Expand Down
29 changes: 28 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,36 @@ target_include_directories(ocpp
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

#############
# Logging configuration
#############
if (EVEREST_CUSTOM_LOGGING_INCLUDE_PATH)
if (NOT EXISTS "${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}/everest/logging.hpp")
message(FATAL_ERROR "everest/logging.hpp not found in directory ${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}")
else()
target_include_directories(ocpp
PUBLIC
include
${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}
)
endif()
message(STATUS "Using the following logging header: ${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}/everest/logging.hpp")
endif()

if (NOT EVEREST_CUSTOM_LOGGING_INCLUDE_PATH)
target_link_libraries(ocpp
PUBLIC
everest::log
)
message(STATUS "Using the default logging header")
endif()

#############
# End logging configuration
#############

target_link_libraries(ocpp
PUBLIC
everest::log
everest::timer
websocketpp::websocketpp
nlohmann_json_schema_validator
Expand Down
1 change: 1 addition & 0 deletions lib/ocpp/common/charging_station_base.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest

#include <boost/make_shared.hpp>
#include <ocpp/common/charging_station_base.hpp>

namespace ocpp {
Expand Down

0 comments on commit fc610b5

Please sign in to comment.