0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 20:28:43 +00:00
bird/client/log.c

58 lines
988 B
C
Raw Normal View History

2023-12-12 13:33:54 +00:00
/*
* BIRD Client Logging Stubs
*
* (c) 2023 Maria Matejka <mq@jmq.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include "nest/bird.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
int shutting_down;
void write_msg(va_list args, const char *msg, const char *type)
{
char buf[4096];
bvsnprintf(buf, sizeof buf, msg, args);
fputs(type, stderr);
fputs(": ", stderr);
fputs(buf, stderr);
fputc('\n', stderr);
}
void cf_error(const char *msg, ...)
{
va_list args;
va_start(args, msg);
write_msg(args, msg, "error");
va_end(args);
exit(1);
}
void log_msg(const char *msg, ...)
{
va_list args;
va_start(args, msg);
write_msg(args, msg, "info");
va_end(args);
exit(1);
}
void debug(const char *msg, ...)
{
va_list args;
va_start(args, msg);
write_msg(args, msg, "debug");
va_end(args);
exit(1);
}
/* Ignore all events for now */
struct event;
void ev_schedule(struct event *e UNUSED)
{ }