mirror of
https://github.com/hyprwm/hyprutils.git
synced 2025-12-20 04:40:08 +01:00
fix
This commit is contained in:
parent
fe829f2913
commit
c052d6a865
2 changed files with 7 additions and 2 deletions
|
|
@ -66,8 +66,10 @@ void CLogger::log(eLogLevel level, const std::string_view& msg) {
|
|||
if (level == LOG_TRACE && !m_trace)
|
||||
return;
|
||||
|
||||
std::string logPrefix = "", logPrefixColor = "";
|
||||
std::string logMsg = "";
|
||||
std::lock_guard<std::mutex> lg(m_impl->m_logMtx);
|
||||
|
||||
std::string logPrefix = "", logPrefixColor = "";
|
||||
std::string logMsg = "";
|
||||
|
||||
switch (level) {
|
||||
case LOG_TRACE:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include <hyprutils/cli/Logger.hpp>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <mutex>
|
||||
|
||||
namespace Hyprutils::CLI {
|
||||
class CLoggerImpl {
|
||||
|
|
@ -24,6 +25,8 @@ namespace Hyprutils::CLI {
|
|||
bool m_fileEnabled = false;
|
||||
bool m_colorEnabled = true;
|
||||
|
||||
std::mutex m_logMtx;
|
||||
|
||||
// this is fine because CLogger is NOMOVE and NOCOPY
|
||||
CLogger* m_parent = nullptr;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue