Merge pull request #262 from chexum/gcc4x
common: avoid std::ofstream copy
This commit is contained in:
commit
6adf37e3c1
@ -87,8 +87,8 @@ bool CommandHandler::executeBeforeContext()
|
|||||||
|
|
||||||
if (vm.count("log")) {
|
if (vm.count("log")) {
|
||||||
std::string logfilename = vm["log"].as<std::string>();
|
std::string logfilename = vm["log"].as<std::string>();
|
||||||
logfile = std::ofstream(logfilename);
|
logfile.open(logfilename);
|
||||||
if (!logfile)
|
if (!logfile.is_open())
|
||||||
log_error("Failed to open log file '%s' for writing.\n", logfilename.c_str());
|
log_error("Failed to open log file '%s' for writing.\n", logfilename.c_str());
|
||||||
log_streams.push_back(std::make_pair(&logfile, LogLevel::LOG_MSG));
|
log_streams.push_back(std::make_pair(&logfile, LogLevel::LOG_MSG));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user