Skip to content

Commit fc77734

Browse files
committed
Some Mac adjustments for unstable logging
1 parent e6e9da9 commit fc77734

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/Core/Logging/Log.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ namespace SCIRun
147147
explicit LogImpl(const std::string& name) : name_(name), cppLogger_(log4cpp::Category::getInstance(name)), latestStream_(new LogStreamImpl(cppLogger_.infoStream()))
148148
{
149149
/// @todo
150-
setBasicAppenders();
150+
//setBasicAppenders();
151151
cppLogger_.setAdditivity(false);
152152
cppLogger_.setPriority(log4cpp::Priority::INFO); //?
153153
}
@@ -219,7 +219,7 @@ namespace SCIRun
219219
{
220220
log4cpp::Appender *appender1 = new log4cpp::OstreamAppender("console", &std::cout);
221221
trySetPattern(appender1);
222-
222+
223223
file_ = Log::logDirectory() / ("scirun5_" + name_ + ".log");
224224
log4cpp::Appender *appender2 = new log4cpp::FileAppender("default", file_.string());
225225
trySetPattern(appender2);

src/Interface/Application/ModuleLogWindow.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
#include <QtGui>
3030
#include <iostream>
3131
#include <Interface/Application/ModuleLogWindow.h>
32-
#include <Interface/Application/SCIRunMainWindow.h>
33-
#include <Interface/Application/DialogErrorControl.h>
32+
#include <Interface/Application/SCIRunMainWindow.h>
33+
#include <Interface/Application/DialogErrorControl.h>
3434
#include <Core/Logging/Log.h>
3535

3636
using namespace SCIRun::Gui;
3737
using namespace SCIRun::Dataflow::Networks;
3838
using namespace SCIRun::Core::Logging;
3939

40-
ModuleLogWindow::ModuleLogWindow(const QString& moduleName, boost::shared_ptr<SCIRun::Gui::DialogErrorControl> dialogErrorControl, QWidget* parent) : QDialog(parent), moduleName_(moduleName),
40+
ModuleLogWindow::ModuleLogWindow(const QString& moduleName, boost::shared_ptr<SCIRun::Gui::DialogErrorControl> dialogErrorControl, QWidget* parent) : QDialog(parent), moduleName_(moduleName),
4141
dialogErrorControl_(dialogErrorControl)
4242
{
4343
setupUi(this);
44-
setModal(false);
44+
setModal(false);
4545
setWindowTitle("Log for " + moduleName);
4646
setVisible(false);
4747
buttonBox->button(QDialogButtonBox::Discard)->setText("Clear");
@@ -101,27 +101,35 @@ void ModuleLogger::error(const std::string& msg) const
101101
logSignal("<b>ERROR: " + qmsg + "</b>", red);
102102
alert(red);
103103
popup(qmsg);
104+
#ifdef _WIN32 //again, unstable on Mac. Need a slicker way to avoid collisions.
104105
Log::get("Modules") << ERROR_LOG << formatWithColor("[" + moduleName_ + "] " + msg, std::string("red"));
106+
#endif
105107
}
106108

107109
void ModuleLogger::warning(const std::string& msg) const
108110
{
109111
const QColor yellow = Qt::yellow;
110112
logSignal("WARNING: " + QString::fromStdString(msg), yellow);
111113
alert(yellow);
114+
#ifdef _WIN32 //again, unstable on Mac. Need a slicker way to avoid collisions.
112115
Log::get("Modules") << WARN << formatWithColor("[" + moduleName_ + "] " + msg, std::string("yellow"));
116+
#endif
113117
}
114118

115119
void ModuleLogger::remark(const std::string& msg) const
116120
{
117121
const QColor blue = Qt::blue;
118122
logSignal("REMARK: " + QString::fromStdString(msg), blue);
119123
alert(blue);
124+
#ifdef _WIN32 //again, unstable on Mac. Need a slicker way to avoid collisions.
120125
Log::get("Modules") << NOTICE << formatWithColor("[" + moduleName_ + "] " + msg, std::string("blue"));
126+
#endif
121127
}
122128

123129
void ModuleLogger::status(const std::string& msg) const
124130
{
125131
logSignal(QString::fromStdString(msg), Qt::black);
132+
#ifdef _WIN32 //again, unstable on Mac. Need a slicker way to avoid collisions.
126133
Log::get("Modules") << INFO << formatWithColor("[" + moduleName_ + "] " + msg, std::string("white"));
134+
#endif
127135
}

0 commit comments

Comments
 (0)