From 246fd8630c2eb8f9ceaaaf35035c4f829526fe33 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 8 Nov 2013 11:27:34 +0100 Subject: [PATCH] Output log to /var/log/gmenu2x.log --- src/gmenu2x.cpp | 4 ++-- src/gmenu2x.h | 4 ++++ src/linkapp.cpp | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 2e3e41b..5118bdc 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -372,7 +372,7 @@ void GMenu2X::initMenu() { menu->addActionLink(i,"GMenu2X",BIND(&GMenu2X::showSettings),tr["Configure GMenu2X's options"],"skin:icons/configure.png"); menu->addActionLink(i,tr["Skin"],BIND(&GMenu2X::skinMenu),tr["Configure skin"],"skin:icons/skin.png"); menu->addActionLink(i,tr["Wallpaper"],BIND(&GMenu2X::changeWallpaper),tr["Change GMenu2X wallpaper"],"skin:icons/wallpaper.png"); - if (fileExists(getHome()+"/log.txt")) + if (fileExists(LOG_FILE)) menu->addActionLink(i,tr["Log Viewer"],BIND(&GMenu2X::viewLog),tr["Displays last launched program's output"],"skin:icons/ebook.png"); menu->addActionLink(i,tr["About"],BIND(&GMenu2X::about),tr["Info about GMenu2X"],"skin:icons/about.png"); } @@ -405,7 +405,7 @@ void GMenu2X::about() { } void GMenu2X::viewLog() { - string logfile = getHome()+"/log.txt"; + string logfile = LOG_FILE; if (fileExists(logfile)) { ifstream inf(logfile.c_str(), ios_base::in); if (inf.is_open()) { diff --git a/src/gmenu2x.h b/src/gmenu2x.h index 4ce36d7..5f0cbd0 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -48,6 +48,10 @@ class Surface; #define GMENU2X_SYSTEM_DIR "/usr/share/gmenu2x" #endif +#ifndef LOG_FILE +#define LOG_FILE "/var/log/gmenu2x.log" +#endif + const int LOOP_DELAY = 30000; extern const char *CARD_ROOT; diff --git a/src/linkapp.cpp b/src/linkapp.cpp index 6f49949..0a0689d 100644 --- a/src/linkapp.cpp +++ b/src/linkapp.cpp @@ -621,10 +621,10 @@ void LinkApp::launch(const string &selectedFile) { if (!params.empty()) command += " " + params; #if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) if (gmenu2x->confInt["outputLogs"] && !consoleApp) - command += " &> " + cmdclean(gmenu2x->getHome()) + "/log.txt"; + command += " &> " LOG_FILE; #else if (gmenu2x->confInt["outputLogs"]) - command += " &> " + cmdclean(gmenu2x->getHome()) + "/log.txt"; + command += " &> " LOG_FILE; #endif #ifdef HAVE_LIBOPK if (isOPK)