diff --git a/common/include/villas/log.hpp b/common/include/villas/log.hpp index 31600fc78..a1a4d6e9c 100644 --- a/common/include/villas/log.hpp +++ b/common/include/villas/log.hpp @@ -47,8 +47,8 @@ extern Log logging; class Log { public: - using DistSink = std::shared_ptr; using Level = spdlog::level::level_enum; + using DistSink = spdlog::sinks::dist_sink_mt; protected: Logger logger = logging.get("log"); diff --git a/common/lib/kernel/rt.cpp b/common/lib/kernel/rt.cpp index 421cf522e..af8227822 100644 --- a/common/lib/kernel/rt.cpp +++ b/common/lib/kernel/rt.cpp @@ -42,7 +42,7 @@ namespace villas { namespace kernel { namespace rt { -static auto logger = logging.get("kernel:rt"); +static Logger logger = logging.get("kernel:rt"); int init(int priority, int affinity) { diff --git a/common/lib/kernel/vfio.cpp b/common/lib/kernel/vfio.cpp index 7c222478a..736682560 100644 --- a/common/lib/kernel/vfio.cpp +++ b/common/lib/kernel/vfio.cpp @@ -46,7 +46,7 @@ using namespace villas; -static auto logger = logging.get("kernel:vfio"); +static Logger logger = logging.get("kernel:vfio"); static const char *vfio_pci_region_names[] = { "PCI_BAR0", // VFIO_PCI_BAR0_REGION_INDEX, diff --git a/common/lib/log.cpp b/common/lib/log.cpp index 91985944e..61adbc708 100644 --- a/common/lib/log.cpp +++ b/common/lib/log.cpp @@ -62,7 +62,7 @@ int Log::getWidth() Logger Log::get(const std::string &name) { - auto logger = spdlog::get(name); + Logger logger = spdlog::get(name); if (not logger) logger = std::make_shared(name, sinks); @@ -98,13 +98,13 @@ void Log::parse(json_t *cfg) if (path) { auto sink = std::make_shared(path); - sinks->add_sink(sink); + sinks.add_sink(sink); } if (syslog) { auto sink = std::make_shared("villas", LOG_PID, LOG_DAEMON); - sinks->add_sink(sink); + sinks.add_sink(sink); } if (json_expressions) { @@ -124,7 +124,7 @@ void Log::parse(json_t *cfg) if (ret) throw new JsonError(err); - auto logger = get(name); + Logger logger = get(name); auto level = spdlog::level::from_str(lvl); logger->set_level(level); diff --git a/common/lib/log_legacy.cpp b/common/lib/log_legacy.cpp index f9b9471d7..0f815fade 100644 --- a/common/lib/log_legacy.cpp +++ b/common/lib/log_legacy.cpp @@ -29,7 +29,7 @@ using namespace villas; -auto logger = logging.get("default"); +Logger logger = logging.get("default"); int log_get_width() { diff --git a/common/lib/memory_manager.cpp b/common/lib/memory_manager.cpp index 297da052b..bfcdfc0de 100644 --- a/common/lib/memory_manager.cpp +++ b/common/lib/memory_manager.cpp @@ -189,7 +189,7 @@ MemoryTranslation::getForeignAddr(uintptr_t addrInLocalAddrSpace) const MemoryTranslation& MemoryTranslation::operator+=(const MemoryTranslation& other) { - auto logger = logging.get("MemoryTranslation"); + Logger logger = logging.get("MemoryTranslation"); // set level to debug to enable debug output logger->set_level(spdlog::level::info); diff --git a/common/lib/plugin.cpp b/common/lib/plugin.cpp index 44da7b69c..b7bd5eec6 100644 --- a/common/lib/plugin.cpp +++ b/common/lib/plugin.cpp @@ -96,7 +96,7 @@ Plugin::unload() void Plugin::dump() { - auto logger = Registry::getLogger(); + Logger logger = Registry::getLogger(); logger->info("Name: '{}' Description: '{}'", name, description); } diff --git a/common/lib/terminal.cpp b/common/lib/terminal.cpp index ff2c5c0b5..9cf569e24 100644 --- a/common/lib/terminal.cpp +++ b/common/lib/terminal.cpp @@ -69,7 +69,7 @@ void Terminal::resize(int, siginfo_t *, void *) if (ret) throw new SystemError("Failed to get terminal dimensions"); - auto logger = logging.get("terminal"); + Logger logger = logging.get("terminal"); logger->debug("New terminal size: {}x{}", window.ws_row, window.ws_col); }; diff --git a/common/lib/utils.cpp b/common/lib/utils.cpp index 4a08bf794..c766a14f5 100644 --- a/common/lib/utils.cpp +++ b/common/lib/utils.cpp @@ -101,7 +101,7 @@ int signals_init(void (*cb)(int signal, siginfo_t *sinfo, void *ctx)) { int ret; - auto logger = logging.get("signals"); + Logger logger = logging.get("signals"); logger->info("Initialize subsystem"); diff --git a/common/tests/graph.cpp b/common/tests/graph.cpp index d0bf50973..bb18b9224 100644 --- a/common/tests/graph.cpp +++ b/common/tests/graph.cpp @@ -33,7 +33,7 @@ TestSuite(graph, .description = "Graph library"); Test(graph, basic, .description = "DirectedGraph") { - auto logger = logging.get("test:graph:basic"); + Logger logger = logging.get("test:graph:basic"); villas::graph::DirectedGraph<> g("test:graph:basic"); logger->info("Testing basic graph construction and modification"); @@ -64,7 +64,7 @@ Test(graph, basic, .description = "DirectedGraph") Test(graph, path, .description = "Find path") { - auto logger = logging.get("test:graph:path"); + Logger logger = logging.get("test:graph:path"); logger->info("Testing path finding algorithm"); using Graph = villas::graph::DirectedGraph<>; @@ -128,7 +128,7 @@ Test(graph, path, .description = "Find path") Test(graph, memory_manager, .description = "Global Memory Manager") { - auto logger = logging.get("test:graph:mm"); + Logger logger = logging.get("test:graph:mm"); auto& mm = villas::MemoryManager::get(); logger->info("Create address spaces"); diff --git a/common/tests/logging.cpp b/common/tests/logging.cpp index 8f8cf88be..a9cf6c7c1 100644 --- a/common/tests/logging.cpp +++ b/common/tests/logging.cpp @@ -58,7 +58,7 @@ static int format_msg(char *buf, size_t buflen, const char *msg, va_list args) void criterion_log_noformat(enum criterion_severity severity, const char *msg) { - auto logger = logging.get("criterion"); + Logger logger = logging.get("criterion"); switch (severity) { case CR_LOG_WARNING: @@ -84,7 +84,7 @@ void criterion_vlog(enum criterion_logging_level /* level */, const char *msg, v format_msg(formatted_msg, sizeof(formatted_msg), msg, args); - auto logger = logging.get("test"); + Logger logger = logging.get("test"); logger->info(formatted_msg); } @@ -101,7 +101,7 @@ void criterion_plog(enum criterion_logging_level /* level */, const struct crite format_msg(formatted_msg, sizeof(formatted_msg), msg, args); va_end(args); - auto logger = logging.get("test"); + Logger logger = logging.get("test"); if (!strcmp(prefix->prefix, "----") && !strcmp(prefix->color, "\33[0;34m")) logger->info(formatted_msg);