9 #include "gmlc/libguarded/shared_guarded.hpp"
10 #include "nlohmann/json_fwd.hpp"
16 #include <string_view>
26 std::atomic<std::size_t> mMaxSize{0};
29 static constexpr std::size_t cDefaultBufferSize{10UL};
31 explicit LogBuffer(std::size_t maxSize): mMaxSize(maxSize) {}
32 void resize(std::size_t newSize);
33 void enable(
bool enable =
true);
34 std::size_t capacity()
const {
return mMaxSize; }
35 std::size_t size()
const {
return mBuffer.lock()->size(); }
37 void push(
int logLevel, std::string_view header, std::string_view message);
40 process(
const std::function<
void(
int, std::string_view, std::string_view)>& procFunc)
const;
Definition: application_api/Federate.hpp:27
Definition: LogBuffer.hpp:22
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
void bufferToJson(const LogBuffer &buffer, nlohmann::json &base)
Definition: LogBuffer.cpp:64