~ubuntu-branches/ubuntu/vivid/xfce4-session/vivid-proposed

« back to all changes in this revision

Viewing changes to xfce4-session/xfsm-global.c

  • Committer: Package Import Robot
  • Author(s): Sean Davis
  • Date: 2014-12-01 21:12:28 UTC
  • mfrom: (1.4.6) (4.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20141201211228-bqdgmiclbn2e9823
Tags: 4.11.1-0ubuntu1
* New upstream release.
* debian/patches:
  - Dropped 02_runtime-logind-support.patch and
    xubuntu_set-xdg-current-desktop.patch, included upstream.
  - Refreshed 01_fix-xrdb-call.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
    }
74
74
}
75
75
 
 
76
gboolean
 
77
xfsm_is_verbose_enabled (void)
 
78
{
 
79
  return verbose;
 
80
}
76
81
 
77
82
void
78
 
xfsm_verbose_real (const gchar *format, ...)
 
83
xfsm_verbose_real (const char *func,
 
84
                   const char *file,
 
85
                   int line,
 
86
                   const char *format,
 
87
                   ...)
79
88
{
80
89
  static FILE *fp = NULL;
81
90
  gchar       *logfile;
82
91
  va_list      valist;
83
 
  GTimeVal     tv;
84
92
 
85
93
  if (G_UNLIKELY (fp == NULL))
86
94
    {
87
95
      logfile = xfce_get_homefile (".xfce4-session.verbose-log", NULL);
 
96
 
 
97
      /* rename an existing log file to -log.last */
 
98
      if (logfile && g_file_test (logfile, G_FILE_TEST_EXISTS))
 
99
        {
 
100
          gchar *oldlogfile = g_strdup_printf ("%s.last", logfile);
 
101
          if (oldlogfile)
 
102
            {
 
103
              rename (logfile, oldlogfile);
 
104
              g_free (oldlogfile);
 
105
            }
 
106
        }
 
107
 
88
108
      fp = fopen (logfile, "w");
89
109
      g_free (logfile);
 
110
      fprintf(fp, "log file opened\n");
90
111
    }
91
112
 
92
 
  g_get_current_time(&tv);
93
 
  fprintf(fp, "[%10lu] ", tv.tv_sec);
94
 
 
 
113
  fprintf (fp, "TRACE[%s:%d] %s(): ", file, line, func);
95
114
  va_start (valist, format);
96
115
  vfprintf (fp, format, valist);
97
116
  fflush (fp);