History

Merge pull request #3681 from birarda/verbose-log-silencer

logging tweaks to reduce spam from repeated log messages

Brad Hefta-Gaub committed 12 years ago

Commit be65a792 parents 8254824 9af097916 files · +238 −211Browse files

Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all

Unified · Split

interface/src/Application.cpp+5−11
@@ -58,7 +58,7 @@ · 57 unmodified lines
5858 #include <HFActionEvent.h>
5959 #include <HFBackEvent.h>
6060 #include <LocalVoxelsList.h>
61−#include <Logging.h>
61+#include <LogHandler.h>
6262 #include <NetworkAccessManager.h>
6363 #include <OctalCode.h>
6464 #include <OctreeSceneStats.h>
@@ -116,12 +116,10 @@ const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::D · 51 unmodified lines
116116 const QString DEFAULT_SCRIPTS_JS_URL = "http://public.highfidelity.io/scripts/defaultScripts.js";
117117
118118 void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
119− if (message.size() > 0) {
120− QString dateString = QDateTime::currentDateTime().toTimeSpec(Qt::LocalTime).toString(Qt::ISODate);
121− QString formattedMessage = QString("[%1] %2\n").arg(dateString).arg(message);
122−
123− fprintf(stdout, "%s", qPrintable(formattedMessage));
124− Application::getInstance()->getLogger()->addMessage(qPrintable(formattedMessage));
119+ QString logMessage = LogHandler::getInstance().printMessage((LogMsgType) type, context, message);
120+
121+ if (!logMessage.isEmpty()) {
122+ Application::getInstance()->getLogger()->addMessage(qPrintable(logMessage));
125123 }
126124 }
127125
@@ -581,10 +579,6 @@ void Application::initializeGL() { · 453 unmodified lines
581579 float startupTime = (float)_applicationStartupTime.elapsed() / 1000.0;
582580 _justStarted = false;
583581 qDebug("Startup time: %4.2f seconds.", startupTime);
584− const char LOGSTASH_INTERFACE_START_TIME_KEY[] = "interface-start-time";
585−
586− // ask the Logstash class to record the startup time
587− Logging::stashValue(STAT_TYPE_TIMER, LOGSTASH_INTERFACE_START_TIME_KEY, startupTime);
588582 }
589583
590584 // update before the first render

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t