mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Close the target file in CLogFileTarget's destructor
This commit is contained in:
@@ -402,3 +402,7 @@ void CLogFileTarget::write(const LogRecord & record)
|
|||||||
|
|
||||||
const CLogFormatter & CLogFileTarget::getFormatter() const { return formatter; }
|
const CLogFormatter & CLogFileTarget::getFormatter() const { return formatter; }
|
||||||
void CLogFileTarget::setFormatter(const CLogFormatter & formatter) { this->formatter = formatter; }
|
void CLogFileTarget::setFormatter(const CLogFormatter & formatter) { this->formatter = formatter; }
|
||||||
|
|
||||||
|
CLogFileTarget::~CLogFileTarget() {
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ public:
|
|||||||
/// Constructs a CLogFileTarget and opens the file designated by filePath. If the append parameter is true, the file
|
/// Constructs a CLogFileTarget and opens the file designated by filePath. If the append parameter is true, the file
|
||||||
/// will be appended to. Otherwise the file designated by filePath will be truncated before being opened.
|
/// will be appended to. Otherwise the file designated by filePath will be truncated before being opened.
|
||||||
explicit CLogFileTarget(boost::filesystem::path filePath, bool append = true);
|
explicit CLogFileTarget(boost::filesystem::path filePath, bool append = true);
|
||||||
|
~CLogFileTarget();
|
||||||
|
|
||||||
const CLogFormatter & getFormatter() const;
|
const CLogFormatter & getFormatter() const;
|
||||||
void setFormatter(const CLogFormatter & formatter);
|
void setFormatter(const CLogFormatter & formatter);
|
||||||
|
|||||||
Reference in New Issue
Block a user