change in logger and initialization
Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
2 files changed
+36
-2
No files matched your search
@@ -13,6 +13,7 @@ struct Logger : public std::enable_shared_from_this<Logger> {
|
||||
|
||||
virtual std::string_view prefix() const noexcept = 0;
|
||||
virtual void setLevel(Level) noexcept = 0;
|
||||
virtual void setMaxBytes(std::uintmax_t) noexcept = 0;
|
||||
virtual Level level() const noexcept = 0;
|
||||
|
||||
template <class... Args>
|
||||
@@ -21,8 +22,8 @@ struct Logger : public std::enable_shared_from_this<Logger> {
|
||||
Message m;
|
||||
m.ts = std::chrono::system_clock::now();
|
||||
m.level = lvl;
|
||||
m.prefix = std::string(prefix());
|
||||
m.text = std::vformat(fmt.get(), std::make_format_args(std::forward<Args>(args)...));
|
||||
m.prefix = "[" + std::string(prefix()) + "]";
|
||||
m.text = std::format(fmt, std::forward<Args>(args)...);
|
||||
enqueue(std::move(m));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user