1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-26 19:35:30 +02:00

Output log to /var/log/gmenu2x.log

This commit is contained in:
Paul Cercueil 2013-11-08 11:27:34 +01:00
parent 217a9b5cd6
commit 246fd8630c
3 changed files with 8 additions and 4 deletions

View File

@ -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()) {

View File

@ -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;

View File

@ -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)