History

replace LogDisplay with File logger

- added abstract logger interface

Stojce Slavkovski committed 12 years ago

Commit ee1eb251 parent 3d44ab913 files · +150 −59Browse files

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

Unified · Split

interface/src/Application.cpp+7−10
@@ -88,7 +88,7 @@ const float MIRROR_REARVIEW_BODY_DISTANCE = 1.f; · 87 unmodified lines
8888
8989 void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
9090 fprintf(stdout, "%s", message.toLocal8Bit().constData());
91− LogDisplay::instance.addMessage(message.toLocal8Bit().constData());
91+ Application::getInstance()->getLogger()->addMessage(message.toLocal8Bit().constData());
9292 }
9393
9494 Application::Application(int& argc, char** argv, timeval &startup_time) :
@@ -149,6 +149,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 54 unmodified lines
149149 QFontDatabase::addApplicationFont("resources/styles/Inconsolata.otf");
150150 _window->setWindowTitle("Interface");
151151
152+ _logger = new FileLogger();
153+
152154 qInstallMessageHandler(messageHandler);
153155
154156 // call Menu getInstance static method to set up the menu
@@ -1346,7 +1348,7 @@ void Application::idle() { · 1191 unmodified lines
13461348 // Normally we check PipelineWarnings, but since idle will often take more than 10ms we only show these idle timing
13471349 // details if we're in ExtraDebugging mode. However, the ::update() and it's subcomponents will show their timing
13481350 // details normally.
1349− bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::ExtraDebugging);
1351+ bool showWarnings = getLogger()->extraDebugging();
13501352 PerformanceWarning warn(showWarnings, "Application::idle()");
13511353
13521354 timeval check;
@@ -2665,7 +2667,7 @@ void Application::queryOctree(NODE_TYPE serverType, PACKET_TYPE packetType, Node · 1312 unmodified lines
26652667 return;
26662668 }
26672669
2668− bool wantExtraDebugging = Menu::getInstance()->isOptionChecked(MenuOption::ExtraDebugging);
2670+ bool wantExtraDebugging = getLogger()->extraDebugging();
26692671
26702672 // These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
26712673 _voxelQuery.setWantLowResMoving(!Menu::getInstance()->isOptionChecked(MenuOption::DisableLowRes));
@@ -3349,11 +3351,6 @@ void Application::displayOverlay() { · 677 unmodified lines
33493351 if (Menu::getInstance()->isOptionChecked(MenuOption::CoverageMap)) {
33503352 renderCoverageMap();
33513353 }
3352−
3353−
3354− if (Menu::getInstance()->isOptionChecked(MenuOption::Log)) {
3355− LogDisplay::instance.render(_glWidget->width(), _glWidget->height());
3356− }
33573354
33583355 // Show chat entry field
33593356 if (_chatEntryOn) {
@@ -4356,7 +4353,7 @@ void* Application::networkReceive(void* args) { · 996 unmodified lines
43564353 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
43574354 "Application::networkReceive()... _voxelProcessor.queueReceivedPacket()");
43584355
4359− bool wantExtraDebugging = Menu::getInstance()->isOptionChecked(MenuOption::ExtraDebugging);
4356+ bool wantExtraDebugging = app->getLogger()->extraDebugging();
43604357 if (wantExtraDebugging && app->_incomingPacket[0] == PACKET_TYPE_VOXEL_DATA) {
43614358 int numBytesPacketHeader = numBytesForPacketHeader(app->_incomingPacket);
43624359 unsigned char* dataAt = app->_incomingPacket + numBytesPacketHeader;
@@ -4481,7 +4478,7 @@ void Application::loadScript() { · 118 unmodified lines
44814478
44824479 void Application::toggleLogDialog() {
44834480 if (! _logDialog) {
4484− _logDialog = new LogDialog(_glWidget);
4481+ _logDialog = new LogDialog(_glWidget, getLogger());
44854482 _logDialog->show();
44864483 } else {
44874484 _logDialog->close();

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