Linux/MacOS - only write colour codes to TTYs

This prevents the colour codes from showing up in piped output, file
redirects, etc.
This commit is contained in:
Ian Rees
2017-04-06 20:49:30 +12:00
committed by wmayer
parent 4976c0dc4a
commit ec715e36fd
2 changed files with 47 additions and 20 deletions

View File

@@ -130,7 +130,7 @@ public:
enum FreeCAD_ConsoleMsgType {
MsgType_Txt = 1,
MsgType_Log = 2,
MsgType_Log = 2,
MsgType_Wrn = 4,
MsgType_Err = 8
} ;
@@ -226,6 +226,8 @@ public:
virtual void Error (const char *sErr);
virtual void Log (const char *sErr);
const char* Name(void){return "Console";}
protected:
bool useColorStderr;
};
class BaseExport RedirectStdOutput : public std::streambuf