Skip to content

Commit 18c86cb

Browse files
author
Matthias Koefferlein
committed
Supporting log levels <0 on command line too, consistent behavior or log dialog
1 parent 44038ce commit 18c86cb

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

src/klayout_main/klayout_main/klayout.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@ klayout_main (int &argc, char **argv)
322322

323323
int v = 0;
324324
tl::from_string (argv [++i], v);
325-
if (v < 0) {
326-
v = 0;
327-
}
328325
tl::verbosity (v);
329326

330327
}

src/lay/lay/LogViewerDialog.ui

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
</property>
3232
<item row="0" column="1">
3333
<widget class="QComboBox" name="verbosity_cbx">
34+
<item>
35+
<property name="text">
36+
<string>No warnings, no errors</string>
37+
</property>
38+
</item>
39+
<item>
40+
<property name="text">
41+
<string>No warnings</string>
42+
</property>
43+
</item>
3444
<item>
3545
<property name="text">
3646
<string>Silent</string>

src/lay/lay/layApplication.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,6 @@ ApplicationBase::parse_cmd (int &argc, char **argv)
312312

313313
int v = 0;
314314
tl::from_string (args [++i], v);
315-
if (v < 0) {
316-
v = 0;
317-
}
318315
tl::verbosity (v);
319316

320317
} else if (a == "-k" && (i + 1) < argc) {
@@ -1065,7 +1062,7 @@ ApplicationBase::usage ()
10651062
r += tl::to_string (QObject::tr (" -b Batch mode (same as -zz -nc -rx)")) + "\n";
10661063
r += tl::to_string (QObject::tr (" -c <config file> Use this configuration file")) + "\n";
10671064
r += tl::to_string (QObject::tr (" -nc Don't use a configuration file (implies -t)")) + "\n";
1068-
r += tl::to_string (QObject::tr (" -d <debug level> Set debug level")) + "\n";
1065+
r += tl::to_string (QObject::tr (" -d <log level> Set log level")) + "\n";
10691066
r += tl::to_string (QObject::tr (" -e Editable mode (allow editing of files)")) + "\n";
10701067
r += tl::to_string (QObject::tr (" -ne Readonly mode (editing of files is disabled)")) + "\n";
10711068
r += tl::to_string (QObject::tr (" -gr <file name> Record GUI test file")) + "\n";

src/lay/lay/layLogViewerDialog.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ LogReceiver::begin ()
107107
// LogFile implementation
108108

109109
LogFile::LogFile (size_t max_entries, bool register_global)
110-
: m_error_receiver (this, 0, &LogFile::add_error),
110+
: m_error_receiver (this, -10, &LogFile::add_error),
111111
m_warn_receiver (this, 0, &LogFile::add_warn),
112-
m_log_receiver (this, 0, &LogFile::add_info),
112+
m_log_receiver (this, 10, &LogFile::add_info),
113113
m_info_receiver (this, 0, &LogFile::add_info),
114114
m_max_entries (max_entries),
115115
m_generation_id (0),
@@ -347,7 +347,7 @@ LogViewerDialog::LogViewerDialog (QWidget *parent, bool register_global, bool in
347347
verbosity_cbx->hide ();
348348
verbosity_label->hide ();
349349
} else {
350-
verbosity_cbx->setCurrentIndex (std::min (4, tl::verbosity () / 10));
350+
verbosity_cbx->setCurrentIndex (std::max (-2, std::min (4, tl::verbosity () / 10)) + 2);
351351
connect (verbosity_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (verbosity_changed (int)));
352352
}
353353

@@ -371,7 +371,7 @@ LogViewerDialog::LogViewerDialog (QWidget *parent, bool register_global, bool in
371371
void
372372
LogViewerDialog::verbosity_changed (int index)
373373
{
374-
tl::verbosity (index * 10 + 1);
374+
tl::verbosity ((index - 2) * 10 + 1);
375375
}
376376

377377
// -----------------------------------------------------------------

0 commit comments

Comments
 (0)