| 42 | { |
| 43 | |
| 44 | Log::Log(std::string const& leaderString, std::string const& outputName, |
| 45 | bool timing) |
| 46 | : m_level(LogLevel::Warning) |
| 47 | , m_deleteStreamOnCleanup(false) |
| 48 | , m_timing(timing) |
| 49 | { |
| 50 | if (Utils::iequals(outputName, "stdlog")) |
| 51 | m_log = &std::clog; |
| 52 | else if (Utils::iequals(outputName, "stderr")) |
| 53 | m_log = &std::cerr; |
| 54 | else if (Utils::iequals(outputName, "stdout")) |
| 55 | m_log = &std::cout; |
| 56 | else if (Utils::iequals(outputName, "devnull")) |
| 57 | m_log = &m_nullStream; |
| 58 | else |
| 59 | { |
| 60 | m_log = Utils::createFile(outputName); |
| 61 | m_deleteStreamOnCleanup = true; |
| 62 | } |
| 63 | m_leaders.push(leaderString); |
| 64 | if (m_timing) |
| 65 | m_start = m_clock.now(); |
| 66 | } |
| 67 | |
| 68 | |
| 69 | Log::Log(std::string const& leaderString, std::ostream* v, bool timing) |
nothing calls this directly
no test coverage detected