Follow up question, so it works, but only in certain cases in my code, if I wrap it in an if statement at all, it wont output to the file...
See the output, if I remove the if statement it will output to the file, if I leave it in all it will do is not print to the console but not output to the file.
// Enable Logging if in Debug Mode
if(_DEBUG)
{
// Base Name, Enabled, Has Date
Logger::Init("Soaring Steele",true,true);
}
else
{
// Base Name, Enabled, Has Date
Logger::Init("Soaring Steele",false,true);
}
// Redirect the standard error to a file, if logging is enabled.
// For some reason you cannt wrap an if statement around this or it fails to work right.
// So comment out if you dont want the standard error going here.
if(Logger::isEnabled)
{
std::ofstream file(Logger::logFile.c_str(), std::ios::app);
std::streambuf* previous = sf::err().rdbuf(file.rdbuf());
}