log file put in $HOME/.ppastats
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 1 Mar 2014 11:10:55 +0000 (11:10 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 1 Mar 2014 11:10:55 +0000 (11:10 +0000)
NEWS
src/main.c

diff --git a/NEWS b/NEWS
index b1dfa99..b47a9fa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ v1.2.0
 * added date created information in the generated HTML for a package
   version.
 * added command line option to specify the theme directory (-t).
+* log file is put into $HOME/.ppastats dir instead of current dir.
 
 v1.1.0
 ------
index cc7f625..83939dd 100644 (file)
@@ -31,6 +31,7 @@
 #include "http.h"
 #include "lp_ws.h"
 #include "config.h"
+#include <pio.h>
 #include <plog.h>
 #include "ppastats.h"
 
@@ -151,7 +152,7 @@ static void print_help()
 
 int main(int argc, char **argv)
 {
-       char *owner, *ppa, *package_status, *output_dir, *theme_dir;
+       char *owner, *ppa, *package_status, *output_dir, *theme_dir, *log, *tmp;
        int optc, output_html, cmdok, install_static_files, ws_size, opti;
 
        program_name = argv[0];
@@ -212,7 +213,11 @@ int main(int argc, char **argv)
                exit(EXIT_FAILURE);
        }
 
-       log_open("ppastats.log");
+       tmp = path_append(getenv("HOME"), ".ppastats");
+       log = path_append(tmp, "ppastats.log");
+       log_open(log);
+       free(tmp);
+       free(log);
 
        owner = argv[optind];
        ppa = argv[optind+1];