mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-13 11:40:38 +02:00
logger now supports unicode file paths
This commit is contained in:
parent
c385c8757b
commit
92dd194c97
@ -12,6 +12,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../CConsoleHandler.h"
|
#include "../CConsoleHandler.h"
|
||||||
|
#include "../filesystem/FileStream.h"
|
||||||
|
|
||||||
class CLogger;
|
class CLogger;
|
||||||
struct LogRecord;
|
struct LogRecord;
|
||||||
@ -147,7 +148,7 @@ private:
|
|||||||
|
|
||||||
/// Macros for tracing the control flow of the application conveniently. If the LOG_TRACE macro is used it should be
|
/// Macros for tracing the control flow of the application conveniently. If the LOG_TRACE macro is used it should be
|
||||||
/// the first statement in the function. Logging traces via this macro have almost no impact when the trace is disabled.
|
/// the first statement in the function. Logging traces via this macro have almost no impact when the trace is disabled.
|
||||||
///
|
///
|
||||||
#define RAII_TRACE(logger, onEntry, onLeave) \
|
#define RAII_TRACE(logger, onEntry, onLeave) \
|
||||||
std::unique_ptr<CTraceLogger> ctl00; \
|
std::unique_ptr<CTraceLogger> ctl00; \
|
||||||
if(logger->isTraceEnabled()) \
|
if(logger->isTraceEnabled()) \
|
||||||
@ -217,7 +218,7 @@ public:
|
|||||||
CLogFormatter(CLogFormatter && move);
|
CLogFormatter(CLogFormatter && move);
|
||||||
|
|
||||||
CLogFormatter(const std::string & pattern);
|
CLogFormatter(const std::string & pattern);
|
||||||
|
|
||||||
CLogFormatter & operator=(const CLogFormatter & copy);
|
CLogFormatter & operator=(const CLogFormatter & copy);
|
||||||
CLogFormatter & operator=(CLogFormatter && move);
|
CLogFormatter & operator=(CLogFormatter && move);
|
||||||
|
|
||||||
@ -302,7 +303,7 @@ public:
|
|||||||
void write(const LogRecord & record) override;
|
void write(const LogRecord & record) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::filesystem::ofstream file;
|
FileStream file;
|
||||||
CLogFormatter formatter;
|
CLogFormatter formatter;
|
||||||
mutable boost::mutex mx;
|
mutable boost::mutex mx;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user