Skip to content

Commit 426faf2

Browse files
committed
OrcCommand: WolfLauncher: Journal: add optional error level
1 parent 8bf9d3d commit 426faf2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/OrcCommand/Command/WolfLauncher/Journal.h

+10-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class Journal
3232
}
3333

3434
template <typename... FmtArgs>
35-
void Print(const std::wstring_view& commandSet, const std::wstring_view& agent, FmtArgs&&... status) const
35+
void
36+
Print(const std::wstring_view& commandSet, const std::wstring_view& agent, Log::Level level, FmtArgs&&... status)
37+
const
3638
{
3739
const auto timepoint = std::chrono::system_clock::now();
3840

@@ -50,10 +52,16 @@ class Journal
5052
const auto& syslog = Orc::Log::DefaultLogger()->Get(Log::Facility::kSyslog);
5153
if (syslog)
5254
{
53-
syslog->Log(timepoint, Log::Level::Info, Utf16ToUtf8(message, "<unicode conversion failed>"));
55+
syslog->Log(timepoint, level, Utf16ToUtf8(message, "<unicode conversion failed>"));
5456
}
5557
}
5658

59+
template <typename... FmtArgs>
60+
void Print(const std::wstring_view& commandSet, const std::wstring_view& agent, FmtArgs&&... status) const
61+
{
62+
Print(commandSet, agent, Log::Level::Info, std::forward<FmtArgs>(status)...);
63+
}
64+
5765
auto Console() { return std::pair<std::lock_guard<std::mutex>, Command::Console&> {m_mutex, m_console}; }
5866
auto Console() const
5967
{

0 commit comments

Comments
 (0)