-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change log level on several status messages (Fixes #652, Fixes #516) #664
Conversation
debauchee#516) This changes the log level for several statuses (started server, connected to server, server status:) from CLOG_NOTE or CLOG_INFO to CLOG_PRINT so they will be printed to stdout regardless of the log level. This allows the GUI to accurately report the status of the `barriers` or `barrierc` processes in src/gui/src/MainWindow.cpp#L379-L399.
confirm that this works as expected. But made it more obvious that https://github.com/debauchee/barrier/blob/master/src/gui/src/MainWindow.cpp#L539-L548 output the following no matter the level
by more obvious, I mean looking at the logs while testing the levels made it obvious that the INFO is prefixed at any level |
@plessbd I'm not quite sure what you mean.. could you explain a bit more in depth? Cheers. |
It is not related to this change, it was just that while I was testing this and was looking more closely at the logs. Even though I have the log level set to And looking at the code it doesnt care what the log level is on those lines, it just writes to the info logger or now that I look at the code more, only the appendLogDebug function checks the log level before writing, the others do not https://github.com/debauchee/barrier/blob/master/src/gui/src/MainWindow.cpp#L346-L360 I am testing the following diff and will put in a PR if it does what I think it "should" diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp
index 79faf59f..7fea19b4 100644
--- a/src/gui/src/MainWindow.cpp
+++ b/src/gui/src/MainWindow.cpp
@@ -345,7 +345,9 @@ void MainWindow::logError()
void MainWindow::appendLogInfo(const QString& text)
{
- m_pLogWindow->appendInfo(text);
+ if (appConfig().logLevel() >= 3) {
+ m_pLogWindow->appendInfo(text);
+ }
}
void MainWindow::appendLogDebug(const QString& text) {
@@ -536,10 +538,7 @@ void MainWindow::startBarrier()
qDebug() << args;
- // show command if debug log level...
- if (appConfig().logLevel() >= 4) {
- appendLogInfo(QString("command: %1 %2").arg(app, args.join(" ")));
- }
+ appendLogDebug(QString("command: %1 %2").arg(app, args.join(" ")));
appendLogInfo("config file: " + configFilename());
appendLogInfo("log level: " + appConfig().logLevelText()); |
@shymega I think what plessbd is talking about is that when running the client in the GUI it still shows a couple of INFO log level messages before it changes to what it is set to. Here's an example from my server running with this pull:
|
OK. Thanks. Just want to recommend checking out #669, and see if both of your patches conflict with that. |
Fix a few more log messages to be consistent
I am fine with merging #669 and this one, I submitted a PR to @simons-public on this branch if we want to merge them. Or he can make the changes, whatever is easiest. |
A few more log cleanups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections from me. 👍
Merging this PR. Fixes #669 by extension. Thanks! |
This changes the log level for several statuses (started server, connected to server, server status:) from CLOG_NOTE or CLOG_INFO to CLOG_PRINT so they will be printed to stdout regardless of the log level. This allows the GUI to accurately report the status of the
barriers
orbarrierc
processes in MainWindow.cpp#L379-L399Until the IPC connection state messages are implemented this should fix any issues with the GUI not reporting the correct status.
Example output with this change running
barriers
(and ignoring TIS/TSM #653)