Blame src/nautilus-profile.c

Packit a189e0
/*
Packit a189e0
 * Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
Packit a189e0
 *
Packit a189e0
 * This program is free software; you can redistribute it and/or modify
Packit a189e0
 * it under the terms of the GNU General Public License as published by
Packit a189e0
 * the Free Software Foundation; either version 2 of the License, or
Packit a189e0
 * (at your option) any later version.
Packit a189e0
 *
Packit a189e0
 * This program is distributed in the hope that it will be useful,
Packit a189e0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a189e0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit a189e0
 * GNU General Public License for more details.
Packit a189e0
 *
Packit a189e0
 * You should have received a copy of the GNU General Public License
Packit a189e0
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Packit a189e0
 *
Packit a189e0
 * Authors: William Jon McCann <mccann@jhu.edu>
Packit a189e0
 *
Packit a189e0
 */
Packit a189e0
Packit a189e0
#include "config.h"
Packit a189e0
Packit a189e0
#include <stdio.h>
Packit a189e0
#include <string.h>
Packit a189e0
#include <stdarg.h>
Packit a189e0
#include <signal.h>
Packit a189e0
#include <time.h>
Packit a189e0
#include <unistd.h>
Packit a189e0
Packit a189e0
#include <glib.h>
Packit a189e0
#include <glib/gstdio.h>
Packit a189e0
Packit a189e0
#include "nautilus-profile.h"
Packit a189e0
Packit a189e0
void
Packit a189e0
_nautilus_profile_log (const char *func,
Packit a189e0
                       const char *note,
Packit a189e0
                       const char *format,
Packit a189e0
                       ...)
Packit a189e0
{
Packit a189e0
    va_list args;
Packit a189e0
    char *str;
Packit a189e0
    char *formatted;
Packit a189e0
Packit a189e0
    if (format == NULL)
Packit a189e0
    {
Packit a189e0
        formatted = g_strdup ("");
Packit a189e0
    }
Packit a189e0
    else
Packit a189e0
    {
Packit a189e0
        va_start (args, format);
Packit a189e0
        formatted = g_strdup_vprintf (format, args);
Packit a189e0
        va_end (args);
Packit a189e0
    }
Packit a189e0
Packit a189e0
    if (func != NULL)
Packit a189e0
    {
Packit a189e0
        str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname (), func, note ? note : "", formatted);
Packit a189e0
    }
Packit a189e0
    else
Packit a189e0
    {
Packit a189e0
        str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname (), note ? note : "", formatted);
Packit a189e0
    }
Packit a189e0
Packit a189e0
    g_free (formatted);
Packit a189e0
Packit a189e0
    g_access (str, F_OK);
Packit a189e0
    g_free (str);
Packit a189e0
}