2 * Copyright (C) 2004-2006, Eric Lund
3 * http://www.mvpmc.org/
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * debug.c - functions to produce and control debug output from
28 #include <refmem_local.h>
29 #include <cmyth_local.h>
33 static mvp_debug_ctx_t refmem_debug_ctx = MVP_DEBUG_CTX_INIT("refmem",
37 * refmem_dbg_level(int l)
43 * Set the current debug level to the absolute setting 'l'
44 * permitting all debug messages with a debug level less
45 * than or equal to 'l' to be displayed.
52 refmem_dbg_level(int l)
54 mvp_dbg_setlevel(&refmem_debug_ctx, l);
64 * Set the current debug level so that all debug messages are displayed.
73 mvp_dbg_setlevel(&refmem_debug_ctx, REF_DBG_ALL);
83 * Set the current debug level so that no debug messages are displayed.
92 mvp_dbg_setlevel(&refmem_debug_ctx, REF_DBG_NONE);
98 * Scope: PRIVATE (mapped to __refmem_dbg)
102 * Print a debug message of level 'level' on 'stderr' provided that
103 * the current debug level allows messages of level 'level' to be
111 refmem_dbg(int level, char *fmt, ...)
116 mvp_dbg(&refmem_debug_ctx, level, fmt, ap);