#include <queue>
#include <string>
#include <fstream>
-#include "threads.h"
+#include <thread>
+#include <mutex>
+#include "irrlichttypes.h"
class ILogOutput;
LL_MAX,
};
+typedef u8 LogLevelMask;
+#define LOGLEVEL_TO_MASKLEVEL(x) (1 << x)
+
class Logger {
public:
void addOutput(ILogOutput *out);
void addOutput(ILogOutput *out, LogLevel lev);
+ void addOutputMasked(ILogOutput *out, LogLevelMask mask);
void addOutputMaxLevel(ILogOutput *out, LogLevel lev);
- void removeOutput(ILogOutput *out);
+ LogLevelMask removeOutput(ILogOutput *out);
void setLevelSilenced(LogLevel lev, bool silenced);
void registerThread(const std::string &name);
// written to when one thread has access currently).
// Works on all known architectures (x86, ARM, MIPS).
volatile bool m_silenced_levels[LL_MAX];
- std::map<threadid_t, std::string> m_thread_names;
- mutable Mutex m_mutex;
+ std::map<std::thread::id, std::string> m_thread_names;
+ mutable std::mutex m_mutex;
bool m_trace_enabled;
};