| 35 | } |
| 36 | |
| 37 | void LogSinkConsole::write(LogMessageLevel level, const std::string& module, const std::string& timestamp, const std::string& filename, int line, const std::string& message) |
| 38 | { |
| 39 | std::stringstream ss; |
| 40 | |
| 41 | ss |
| 42 | << "(" << timestamp << ") " |
| 43 | << "(" << module << ") " |
| 44 | << "[" << LogMessageLevelToString(level) << "] "; |
| 45 | |
| 46 | if (level >= LogMessageLevel::WARNING) |
| 47 | ss << "(" << filename << ":" << line << ") "; |
| 48 | |
| 49 | ss |
| 50 | << message |
| 51 | << std::endl; |
| 52 | |
| 53 | if (level >= LogMessageLevel::WARNING) |
| 54 | std::cerr << ss.str(); |
| 55 | else |
| 56 | std::cout << ss.str(); |
| 57 | |
| 58 | #if (WIN32 || _WINDOWS) && OD_DEBUG |
| 59 | ::OutputDebugStringA(ss.str().c_str()); |
| 60 | #endif |
| 61 | } |
nothing calls this directly
no test coverage detected