unbound/util/log.c
Wouter Wijngaards 043f3abb2f doxygen comment test and comments added.
git-svn-id: file:///svn/unbound/trunk@11 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-01-03 14:55:21 +00:00

46 lines
775 B
C

/*
* util/log.c - implementation of the log code
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* See LICENSE for the license.
*
*/
/**
* \file
* Implementation of log.h.
*/
#include "config.h"
#include "util/log.h"
#ifdef HAVE_TIME_H
#include <time.h>
#endif
void
log_init()
{
}
void
log_vmsg(const char *format, va_list args)
{
char message[MAXSYSLOGMSGLEN];
const char* ident="unbound";
vsnprintf(message, sizeof(message), format, args);
fprintf(stderr, "[%d] %s[%d]: %s\n",
(int)time(NULL), ident, (int)getpid(), message);
}
/**
* implementation of log_info
* @param format: format string printf-style.
*/
void
log_info(const char *format, ...)
{
va_list args;
va_start(args, format);
log_vmsg(format, args);
va_end(args);
}