~q3cpma/mus

ref: cf29c2237d0c99e5240a55895c07564ef4635392 mus/mus_player/log.h -rw-r--r-- 456 bytes
cf29c223q3cpma Add a #pragma once to the new xoshiro128plus.h header 1 year, 7 months ago
                                                                                
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
#pragma once

#include <stdlib.h>
#include <syslog.h>

#include "misc.h"

#define LOG_DIE(...)							\
	do											\
	{											\
		log_append(LOG_ERR, __VA_ARGS__);		\
		exit(EXIT_FAILURE);						\
	}											\
	while (0)

typedef enum
{
	LOG_TYPE_SYSLOG,
	LOG_TYPE_STDERR
} Log_type;


void (*log_append)(int, const char *, ...) ATTR_FMT_PRINTF(2, 3);
int (*log_setmask)(int);

void log_init(Log_type type, const char *ident);

void log_free(void);