Pre-ci test passed git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4000 818b1a75-f10b-46b9-bf7c-635c3b92a50f
58 lines
998 B
C
58 lines
998 B
C
/*
|
|
* $Id: log.c,v 1.5 2007/06/21 18:07:23 cparker 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 <freeradius-client.h>
|
|
|
|
/*
|
|
* Function: rc_openlog
|
|
*
|
|
* Purpose: open log
|
|
*
|
|
* Arguments: identification string
|
|
*
|
|
* Returns: nothing
|
|
*
|
|
*/
|
|
|
|
void rc_openlog(char *ident)
|
|
{
|
|
#ifndef _MSC_VER /* TODO: Fix me */
|
|
openlog(ident, LOG_PID, RC_LOG_FACILITY);
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
* 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);
|
|
printf("%s\n", buff);
|
|
#ifndef _MSC_VER /* TODO: Fix me */
|
|
syslog(prio, "%s", buff);
|
|
#endif
|
|
}
|