2 * debug.c: debugging messages
3 * Copyright (C) 2007, 2010 Colin Watson.
5 * This file is part of libpipeline.
7 * libpipeline is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * libpipeline is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with libpipeline; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
33 #include "pipeline-private.h"
37 void init_debug (void)
39 static int inited = 0;
40 const char *pipeline_debug;
46 pipeline_debug = getenv ("PIPELINE_DEBUG");
47 if (pipeline_debug && !strcmp (pipeline_debug, "1"))
51 static void vdebug (const char *message, va_list args)
54 vfprintf (stderr, message, args);
57 void debug (const char *message, ...)
64 va_start (args, message);
65 vdebug (message, args);