projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d9d73c0
)
Main: Add -s option to allow logging to console as before
author
Soeren Apel
<soeren@apelpie.net>
Fri, 30 Mar 2018 08:26:34 +0000
(10:26 +0200)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Fri, 30 Mar 2018 18:20:11 +0000
(20:20 +0200)
main.cpp
patch
|
blob
|
history
diff --git
a/main.cpp
b/main.cpp
index feff17aaf47cd54299ff114871e32247aceedce1..e3bf8835c665b60b04d5c7302ff8b9ad3432a7c9 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-92,6
+92,7
@@
void usage()
" -i, --input-file Load input from file\n"
" -I, --input-format Input format\n"
" -c, --clean Don't restore previous sessions on startup\n"
" -i, --input-file Load input from file\n"
" -I, --input-format Input format\n"
" -c, --clean Don't restore previous sessions on startup\n"
+ " -s, --log-to-stdout Don't use logging, output to stdout instead\n"
"\n", PV_BIN_NAME);
}
"\n", PV_BIN_NAME);
}
@@
-102,6
+103,7
@@
int main(int argc, char *argv[])
string open_file, open_file_format, driver;
bool restore_sessions = true;
bool do_scan = true;
string open_file, open_file_format, driver;
bool restore_sessions = true;
bool do_scan = true;
+ bool do_logging = true;
Application a(argc, argv);
Application a(argc, argv);
@@
-121,11
+123,12
@@
int main(int argc, char *argv[])
{"input-file", required_argument, nullptr, 'i'},
{"input-format", required_argument, nullptr, 'I'},
{"clean", no_argument, nullptr, 'c'},
{"input-file", required_argument, nullptr, 'i'},
{"input-format", required_argument, nullptr, 'I'},
{"clean", no_argument, nullptr, 'c'},
+ {"log-to-stdout", no_argument, nullptr, 's'},
{nullptr, 0, nullptr, 0}
};
const int c = getopt_long(argc, argv,
{nullptr, 0, nullptr, 0}
};
const int c = getopt_long(argc, argv,
- "
l:Vhc?d:D
i:I:", long_options, nullptr);
+ "
h?VDcsl:d:
i:I:", long_options, nullptr);
if (c == -1)
break;
if (c == -1)
break;
@@
-180,6
+183,10
@@
int main(int argc, char *argv[])
case 'c':
restore_sessions = false;
break;
case 'c':
restore_sessions = false;
break;
+
+ case 's':
+ do_logging = false;
+ break;
}
}
}
}
@@
-195,7
+202,8
@@
int main(int argc, char *argv[])
pv::GlobalSettings settings;
settings.set_defaults_where_needed();
pv::GlobalSettings settings;
settings.set_defaults_where_needed();
- pv::logging.init();
+ if (do_logging)
+ pv::logging.init();
// Initialise libsigrok
context = sigrok::Context::create();
// Initialise libsigrok
context = sigrok::Context::create();