mirror of
https://github.com/debauchee/barrier.git
synced 2026-11-26 22:03:24 +08:00
* removed wait cond and mutex usage from gui ipc log reader (it was being used incorrectly anyway)
* raised the log-to-console level to DEBUG2 * added force option to ipc log buffer (to side-step the anti-recursion "mechanism") * made relauncher always relay server/client messages to ipc client (gui)
This commit is contained in:
@@ -114,7 +114,8 @@ public:
|
||||
static CLog* getInstance();
|
||||
|
||||
//! Get the console filter level (messages above this are not sent to console).
|
||||
int getConsoleMaxLevel() const { return kDEBUG1; }
|
||||
int getConsoleMaxLevel() const { return kDEBUG2; }
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
|
||||
@@ -61,7 +61,13 @@ CIpcLogOutputter::show(bool showIfEmpty)
|
||||
}
|
||||
|
||||
bool
|
||||
CIpcLogOutputter::write(ELevel, const char* text)
|
||||
CIpcLogOutputter::write(ELevel level, const char* text)
|
||||
{
|
||||
return write(level, text, false);
|
||||
}
|
||||
|
||||
bool
|
||||
CIpcLogOutputter::write(ELevel, const char* text, bool force)
|
||||
{
|
||||
// sending the buffer generates log messages, which we must throw
|
||||
// away (otherwise this would cause recursion). this is just a drawback
|
||||
@@ -69,7 +75,7 @@ CIpcLogOutputter::write(ELevel, const char* text)
|
||||
// away log messages not generated by the ipc, but it seems like it
|
||||
// would be difficult to distinguish (other than looking at the stack
|
||||
// trace somehow). perhaps a file stream might be a better option :-/
|
||||
if (m_sending) {
|
||||
if (m_sending && !force) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
virtual void close();
|
||||
virtual void show(bool showIfEmpty);
|
||||
virtual bool write(ELevel level, const char* message);
|
||||
virtual bool write(ELevel level, const char* text, bool force);
|
||||
|
||||
private:
|
||||
void bufferThread(void*);
|
||||
|
||||
@@ -414,9 +414,11 @@ CMSWindowsRelauncher::outputLoop(void*)
|
||||
ARCH->sleep(1);
|
||||
}
|
||||
else {
|
||||
// send process output over IPC to GUI.
|
||||
buffer[bytesRead] = '\0';
|
||||
m_ipcLogOutputter.write(kINFO, buffer);
|
||||
|
||||
// send process output over IPC to GUI, and force it to be sent
|
||||
// which bypasses the ipc logging anti-recursion mechanism.
|
||||
m_ipcLogOutputter.write(kINFO, buffer, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user