diff --git a/common/include/villas/log.hpp b/common/include/villas/log.hpp index 9c4f32ec9..6ba1ce549 100644 --- a/common/include/villas/log.hpp +++ b/common/include/villas/log.hpp @@ -68,6 +68,7 @@ public: Logger get(const std::string &name); + void setPattern(const std::string &pattern); void setLevel(Level lvl); void setLevel(const std::string &lvl); diff --git a/common/lib/log.cpp b/common/lib/log.cpp index 8f3e2afc2..e839dcf62 100644 --- a/common/lib/log.cpp +++ b/common/lib/log.cpp @@ -134,6 +134,13 @@ void Log::parse(json_t *cfg) } } +void Log::setPattern(const std::string &pat) +{ + pattern = pat; + + spdlog::set_pattern(pattern, spdlog::pattern_time_type::utc); +} + void Log::setLevel(Level lvl) { spdlog::set_level(lvl);