disable logging when not in portable mode

This commit is contained in:
Berke Viktor 2011-08-17 15:26:08 +02:00
parent 5472a813fa
commit 440e3bc279
1 changed files with 8 additions and 3 deletions

View File

@ -288,10 +288,15 @@ static void populate_with_themes(GtkWidget* w)
static void redirect_to_file (const gchar* log_domain, GLogLevelFlags log_level, static void redirect_to_file (const gchar* log_domain, GLogLevelFlags log_level,
const gchar* message, gpointer user_data) const gchar* message, gpointer user_data)
{ {
/* only write logs if running in portable mode, otherwise
we would get a permission error in program files */
if ((_access( "portable-mode", 0 )) != -1)
{
std::fstream f; std::fstream f;
f.open("g_stdout.txt", std::ios::app); f.open("gtk2-prefs.log", std::ios::app);
f << message << "\n"; f << message << "\n";
f.close(); f.close();
}
} }
#endif #endif