diff options
author | Jonathan Bauer | 2011-04-24 17:42:03 +0200 |
---|---|---|
committer | Jonathan Bauer | 2011-04-24 17:42:03 +0200 |
commit | a7fb2734a2e1e29a63fa60beae00b3a2496c8e5b (patch) | |
tree | b2dfbb79fb1a2e4e4349077a8197b817ebbc1ee8 | |
parent | new logger engine to output in file, configurable per cmdline / config file (diff) | |
download | fbgui-a7fb2734a2e1e29a63fa60beae00b3a2496c8e5b.tar.gz fbgui-a7fb2734a2e1e29a63fa60beae00b3a2496c8e5b.tar.xz fbgui-a7fb2734a2e1e29a63fa60beae00b3a2496c8e5b.zip |
log file config fix
-rw-r--r-- | src/fbgui.h | 2 | ||||
-rw-r--r-- | src/main.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/fbgui.h b/src/fbgui.h index 98ab4c4..5c3247d 100644 --- a/src/fbgui.h +++ b/src/fbgui.h @@ -28,7 +28,7 @@ #define DEFAULT_URL "http://www.google.com" #define DEFAULT_DOWNLOAD_DIR "/tmp/fbgui" #define DEFAULT_CONFIG_PATH "/etc/fbgui.conf" -#define DEFAULT_LOG_FILE_PATH "/tmp/fbgui.log" +#define DEFAULT_LOG_FILE_PATH "/tmp/fbgui.log2" #define DEFAULT_UPDATE_INTERVAL 1; #define DEFAULT_QRC_HTML_DIR ":/html" #define DEFAULT_FILE_TRIGGER "/tmp/fbgui/trigger" diff --git a/src/main.cpp b/src/main.cpp index 24e0430..d51bc02 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,13 +49,13 @@ int main(int argc, char *argv[]) { // parse command line arguments using getopt QMap<QString, QString> clOpts; int longIndex = 0; - static const char *optString = "c:u:d:s:t:D:h"; + static const char *optString = "c:u:d:s:t:D:hl:"; static const struct option longOpts[] = { { "config", required_argument, NULL, 'c' }, { "url", required_argument, NULL, 'u' }, { "download", required_argument, NULL, 'd' }, { "serial", required_argument, NULL, 's' }, { "trigger", required_argument, NULL, 't' }, { "debug", required_argument, NULL, 'D' }, { "help", no_argument, NULL, 'h' }, { - "logfile", required_argument, NULL, 'l' } }; + "log", required_argument, NULL, 'l' } }; int opt = getopt_long(argc, argv, optString, longOpts, &longIndex); while (opt != -1) { switch (opt) { @@ -144,6 +144,7 @@ int main(int argc, char *argv[]) { else downloadPath = DEFAULT_DOWNLOAD_DIR; + // set update interval for download progress functions of download manager. if (confFileSettings.contains("default/update_interval")) updateInterval = confFileSettings.value("default/update_interval").toInt(); @@ -173,8 +174,8 @@ int main(int argc, char *argv[]) { ipConfigFilePath = confFileSettings.value("default/ip_config").toString(); // save path to log file - if (clOpts.contains("logFile")) - logFilePath = clOpts.value("logFile"); + if (clOpts.contains("logFile")){ + logFilePath = clOpts.value("logFile");qxtLog->debug() << "LOG FILE: " << clOpts.value("logFile");} else if (confFileSettings.contains("default/log_file")) logFilePath = confFileSettings.value("default/log_file").toString(); else |