forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nolog.c
34 lines (29 loc) · 807 Bytes
/
nolog.c
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
/**
* @file
*
* @brief C99-compatible Fake Logger Implementation
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#include <kdblogger.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
int elektraLog (int level ELEKTRA_UNUSED, const char * function ELEKTRA_UNUSED, const char * absFile ELEKTRA_UNUSED,
const int line ELEKTRA_UNUSED, const char * mmsg ELEKTRA_UNUSED, ...)
{
return 0;
}
void elektraAbort (const char * expression, const char * function, const char * file, const int line, const char * msg, ...)
{
fprintf (stderr, "%s:%d:%s: Assertion `%s' failed: ", file, line, function, expression);
{
va_list args;
va_start (args, msg);
vfprintf (stderr, msg, args);
va_end (args);
}
fprintf (stderr, "\n");
fflush (stderr);
abort ();
}