File: log.c

package info (click to toggle)
radiusclient 0.3.2-13
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,036 kB
  • ctags: 468
  • sloc: sh: 4,808; ansic: 3,645; perl: 258; makefile: 108
file content (53 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * $Id: log.c,v 1.3 1997/12/29 23:07:22 lf Exp $
 *
 * Copyright (C) 1995,1996,1997 Lars Fenneberg
 *
 * See the file COPYRIGHT for the respective terms and conditions. 
 * If the file is missing contact me at lf@elemental.net 
 * and I'll send you a copy.
 *
 */

#include <config.h>
#include <includes.h>
#include <radiusclient.h>

/*
 * Function: rc_openlog
 *
 * Purpose: open log
 *
 * Arguments: identification string
 *
 * Returns: nothing
 *
 */

void rc_openlog(char *ident)
{
	openlog(ident, LOG_PID, RC_LOG_FACILITY);
}

/*
 * Function: rc_log
 *
 * Purpose: log information
 *
 * Arguments: priority (just like syslog), rest like printf
 *
 * Returns: nothing
 *
 */

void rc_log(int prio, const char *format, ...)
{
	char buff[1024];
	va_list ap;
                                    
	va_start(ap,format);
    vsnprintf(buff, sizeof(buff), format, ap);
    va_end(ap);
                                                            
	syslog(prio, "%s", buff);
}