A few final changes for the 3.0.6 release
[pacman.git] / lib / libalpm / log.c
blobb59ec64e9343fba9de85c04d4ebabe15868f1d47
1 /*
2 * log.c
3 *
4 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
22 #include "config.h"
24 #include <stdio.h>
25 #include <stdarg.h>
26 #include <time.h>
28 /* libalpm */
29 #include "log.h"
30 #include "alpm.h"
32 void _alpm_log(pmloglevel_t flag, char *fmt, ...)
34 alpm_cb_log logcb = alpm_option_get_logcb();
35 if(logcb == NULL) {
36 return;
39 if(flag & alpm_option_get_logmask()) {
40 char str[LOG_STR_LEN];
41 va_list args;
43 va_start(args, fmt);
44 vsnprintf(str, LOG_STR_LEN, fmt, args);
45 va_end(args);
47 logcb(flag, str);
51 /* vim: set ts=2 sw=2 noet: */