messages capture config output, still to find a way to capture all cerr output

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@95 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-10-16 08:29:44 +00:00
parent 863662a5eb
commit e104b1d529
6 changed files with 45 additions and 17 deletions

View File

@ -40,9 +40,12 @@ private:
class qDebugStream : public basic_streambuf<char> {
public:
qDebugStream(ostream &stream, QWidget* w) : m_stream(stream), log_window(w) {
qDebugStream(ostream &stream, ostream &estream, QWidget* w) : m_stream(stream), e_stream(estream), log_window(w) {
m_old_buf = stream.rdbuf();
stream.rdbuf(this);
//e_old_buf = stream.rdbuf();
//estream.rdbuf(this);
};
//-------------------------------------------------------------------------------------------------------------------------------------------------
@ -57,6 +60,7 @@ public:
#endif
}
m_stream.rdbuf(m_old_buf);
e_stream.rdbuf(e_old_buf);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
@ -104,6 +108,8 @@ protected:
private:
ostream &m_stream;
streambuf *m_old_buf;
ostream &e_stream;
streambuf *e_old_buf;
string m_string;
QWidget* log_window;
};