No issues found
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 * Authors: William Jon McCann <mccann@jhu.edu>
20 *
21 */
22
23 #include "config.h"
24
25 #include <stdio.h>
26 #include <string.h>
27 #include <stdarg.h>
28 #include <signal.h>
29 #include <time.h>
30 #include <unistd.h>
31
32 #include <glib.h>
33 #include <glib/gstdio.h>
34
35 #include "nautilus-profile.h"
36
37 void
38 _nautilus_profile_log (const char *func,
39 const char *note,
40 const char *format,
41 ...)
42 {
43 va_list args;
44 char *str;
45 char *formatted;
46
47 if (format == NULL) {
48 formatted = g_strdup ("");
49 } else {
50 va_start (args, format);
51 formatted = g_strdup_vprintf (format, args);
52 va_end (args);
53 }
54
55 if (func != NULL) {
56 str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname(), func, note ? note : "", formatted);
57 } else {
58 str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname(), note ? note : "", formatted);
59 }
60
61 g_free (formatted);
62
63 g_access (str, F_OK);
64 g_free (str);
65 }