mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-20 15:27:00 +00:00
use RAII for log file open/close
This commit is contained in:
1 parent
cd19cd343a
commit
b62676daf4
1 file changed
+1
-3
+1
-3
@@ -94,10 +94,8 @@ void DebugPrintTIDInternal(const std::string& func, bool overwrite) {
|
||||
}
|
||||
|
||||
void addToLog(const std::string& Line) {
|
||||
std::ofstream LFS;
|
||||
LFS.open(("Server.log"), std::ios_base::app);
|
||||
std::ofstream LFS("Server.log", std::ios_base::app);
|
||||
LFS << Line.c_str();
|
||||
LFS.close();
|
||||
}
|
||||
void info(const std::string& toPrint) {
|
||||
std::scoped_lock Guard(LogLock);
|
||||
|
||||
Reference in new issue
Block a user