MCPcopy Create free account
hub / github.com/OpenMW/openmw / Coloured

Class Coloured

components/debug/debugging.cpp:268–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 };
267
268 class Coloured
269 {
270 public:
271 explicit Coloured(std::ostream& stream)
272 : mStream(stream)
273 // TODO: check which stream is stderr?
274 , mUseColor(useColoredOutput())
275 {
276 }
277
278 void write(const char* str, std::streamsize size, Level level)
279 {
280 if (mUseColor)
281 mStream << "\033[0;" << getColor(level) << 'm';
282 mStream.write(str, size);
283 if (mUseColor)
284 mStream << "\033[0;" << Reset << 'm';
285 mStream.flush();
286 }
287
288 private:
289 std::ostream& mStream;
290 bool mUseColor;
291 };
292
293 class Buffer
294 {

Callers 2

setupLoggingFunction · 0.85
wrapApplicationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected