14 #include "../common/LogBuffer.hpp"
15 #include "../helics_enums.h"
16 #include "FederateIdExtra.hpp"
37 std::string logIdentifier;
44 std::vector<std::pair<GlobalFederateId, std::int32_t>> remoteTargets;
46 std::shared_ptr<spdlog::logger> consoleLogger;
48 std::shared_ptr<spdlog::logger> fileLogger;
49 std::atomic<bool> initialized{
false};
52 std::function<void(
int, std::string_view, std::string_view)> loggerFunction;
62 void initializeLogging(
const std::string& identifier);
68 std::string_view header,
69 std::string_view message,
70 bool disableRemote =
false)
const;
80 void setLogLevels(int32_t consoleLevel, int32_t fileLevel);
90 std::function<
void(
int level, std::string_view identifier, std::string_view message)>
93 void setTransmitCallback(std::function<
void(
ActionMessage&& mm)> transmit)
96 mTransmit = std::move(transmit);
98 int getMaxLevel()
const {
return maxLogLevel.load(); }
99 int getFileLevel()
const {
return fileLogLevel; }
100 int getConsoleLevel()
const {
return consoleLogLevel; }
101 void setLoggingFile(std::string_view lfile,
const std::string& identifier);
102 LogBuffer& getLogBuffer() {
return mLogBuffer; }
103 void updateRemote(GlobalFederateId destination,
int level);
106 void updateMaxLogLevel();
Definition: ActionMessage.hpp:30
Definition: LogBuffer.hpp:24
Definition: LogManager.hpp:35
std::atomic< bool > forceLoggingFlush
force the log to flush after every message
Definition: LogManager.hpp:58
void logFlush()
Definition: LogManager.cpp:213
void setLogLevel(int32_t level)
Definition: LogManager.cpp:208
void addLoggingCLI(std::shared_ptr< helicsCLI11App > &app)
Definition: LogManager.cpp:153
void setLogLevels(int32_t consoleLevel, int32_t fileLevel)
Definition: LogManager.cpp:223
void setLoggerFunction(std::function< void(int level, std::string_view identifier, std::string_view message)> logFunction)
Definition: LogManager.cpp:202
bool sendToLogger(int logLevel, std::string_view header, std::string_view message, bool disableRemote=false) const
Definition: LogManager.cpp:90
@ HELICS_LOG_LEVEL_WARNING
Definition: helics_enums.h:210
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14