2 * 2008+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
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.
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.
16 #include <sys/types.h>
18 #include <sys/socket.h>
21 #include <sys/syscall.h>
33 #include "elliptics.h"
35 int dnet_log_init(struct dnet_node
*n
, struct dnet_log
*l
)
45 void dnet_log_raw(struct dnet_node
*n
, int level
, const char *format
, ...)
49 struct dnet_log
*l
= n
->log
;
50 int buflen
= sizeof(buf
);
52 if (!l
->log
|| (l
->log_level
< level
))
55 va_start(args
, format
);
56 vsnprintf(buf
, buflen
, format
, args
);
58 l
->log(l
->log_private
, level
, buf
);