| 212 | } |
| 213 | |
| 214 | void Log::SendTo (const std::string& path) |
| 215 | { |
| 216 | if (m_LogStream) m_LogStream = nullptr; // close previous |
| 217 | auto flags = std::ofstream::out | std::ofstream::app; |
| 218 | auto os = std::make_shared<std::ofstream> (path, flags); |
| 219 | if (os->is_open ()) |
| 220 | { |
| 221 | m_HasColors = false; |
| 222 | m_Logfile = path; |
| 223 | m_Destination = eLogFile; |
| 224 | m_LogStream = os; |
| 225 | return; |
| 226 | } |
| 227 | LogPrint(eLogCritical, "Log: Can't open file ", path); |
| 228 | } |
| 229 | |
| 230 | void Log::SendTo (std::shared_ptr<std::ostream> os) { |
| 231 | m_HasColors = false; |