MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / write

Method write

source/utils/LogSinkConsole.cpp:37–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void 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}

Callers

nothing calls this directly

Calls 1

LogMessageLevelToStringFunction · 0.85

Tested by

no test coverage detected