summaryrefslogtreecommitdiffstats
path: root/subsurface-desktop-main.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-02-02 21:50:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-03 09:24:42 -0800
commit4a894e0713910e68a8744a3b34b95a91b31cabde (patch)
treea0a0b78e286d5b46112eaa8c2562aac5abd3b709 /subsurface-desktop-main.cpp
parent7c8461a328c6d93a89aeb4358bacf0201e940f35 (diff)
downloadsubsurface-4a894e0713910e68a8744a3b34b95a91b31cabde.tar.gz
Win32: add the --win32log option to log stdout and stderr to files
Adding --win32log as the first command line option on Windows will now log all stdout and stderr output to the files subsurface_err.log and subsurface_out.log in the working directory. This change required a new argument 'bool logfile' to be added to: subsurface_console_init() which is defined in all platform files (linux.c, macos.c, etc.) Example usage: subsurface.exe --win32log -v -v -v Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'subsurface-desktop-main.cpp')
-rw-r--r--subsurface-desktop-main.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 165d1f7d9..e30df687c 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -34,9 +34,15 @@ int main(int argc, char **argv)
QStringList importedFiles;
QStringList arguments = QCoreApplication::arguments();
- bool dedicated_console = arguments.length() > 1 &&
- (arguments.at(1) == QString("--win32console"));
- subsurface_console_init(dedicated_console);
+ bool win32_log = arguments.length() > 1 &&
+ (arguments.at(1) == QString("--win32log"));
+ if (win32_log) {
+ subsurface_console_init(true, true);
+ } else {
+ bool dedicated_console = arguments.length() > 1 &&
+ (arguments.at(1) == QString("--win32console"));
+ subsurface_console_init(dedicated_console, false);
+ }
const char *default_directory = system_default_directory();
const char *default_filename = system_default_filename();