mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 01:55:06 -05:00
client: add logging function to allow linking with memory.o
This commit is contained in:
19
client.c
19
client.c
@@ -31,6 +31,7 @@
|
|||||||
#include "sysincl.h"
|
#include "sysincl.h"
|
||||||
|
|
||||||
#include "candm.h"
|
#include "candm.h"
|
||||||
|
#include "logging.h"
|
||||||
#include "nameserv.h"
|
#include "nameserv.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "getdate.h"
|
#include "getdate.h"
|
||||||
@@ -69,6 +70,24 @@ static int no_dns = 0;
|
|||||||
|
|
||||||
static int recv_errqueue = 0;
|
static int recv_errqueue = 0;
|
||||||
|
|
||||||
|
/* ================================================== */
|
||||||
|
/* Log a message. This is a minimalistic replacement of the logging.c
|
||||||
|
implementation to avoid linking with it and other modules. */
|
||||||
|
|
||||||
|
int log_debug_enabled = 0;
|
||||||
|
|
||||||
|
void LOG_Message(LOG_Severity severity, LOG_Facility facility,
|
||||||
|
int line_number, const char *filename,
|
||||||
|
const char *function_name, const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
|
vfprintf(stderr, format, ap);
|
||||||
|
putc('\n', stderr);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
/* Read a single line of commands from standard input. Eventually we
|
/* Read a single line of commands from standard input. Eventually we
|
||||||
might want to use the GNU readline library. */
|
might want to use the GNU readline library. */
|
||||||
|
|||||||
Reference in New Issue
Block a user