8 Log::Log() : mName(std::to_string(msID++)) {}
14 if (where ==
"console" || where ==
"") {
16 mSinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_st>());
18 else if (where.find(
"file://") == 0) {
22 std::string p = where.substr(7);
23 SPD_TRACE(
"Testing file [{}] for write ...", p);
24 std::ofstream output(p.c_str());
25 if (output.is_open()) {
27 SPD_TRACE(
"Testing file [{}] for write is OK ...", p);
28 mSinks.push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(p.c_str(),
true));
31 SPD_WARN(
"Problem creating log file [{}]!!!", p);
35 else if (where.find(
"zmq://") == 0) {
53 mName = fmt::format(
"salsa-runlog-{}",
msID);
static uint64_t msID
Static Job newName (holds index)
int write(char const *)
Write to logger.
std::string mName
newName (name) of current job
std::vector< spdlog::sink_ptr > mSinks
Sinks for SPDLOG.
int create()
Create SPDLOG loger.
std::shared_ptr< spdlog::logger > mpTarget
SPDLOG logger handle.
int add(std::string)
Add output sink (file, console, zmq) for SPDLOG.