debug.h 1.07 KB
Newer Older
venaas's avatar
venaas committed
1 2
/*
 * Copyright (C) 2007 Stig Venaas <venaas@uninett.no>
Linus Nordberg's avatar
Linus Nordberg committed
3
 * Copyright (C) 2010,2011 NORDUnet A/S
venaas's avatar
venaas committed
4 5 6 7 8 9
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 */

venaas's avatar
venaas committed
10
#ifndef SYS_SOLARIS9
11
#include <stdint.h>
venaas's avatar
venaas committed
12
#endif
13

venaas's avatar
venaas committed
14
#define DBG_DBG 8
venaas's avatar
venaas committed
15
#define DBG_INFO 16
Linus Nordberg's avatar
Linus Nordberg committed
16 17 18
#define DBG_NOTICE 32
#define DBG_WARN 64
#define DBG_ERR 128
venaas's avatar
venaas committed
19

20 21
#define LOG_TYPE_DEBUG 0
#define LOG_TYPE_FTICKS 1
22

23
void debug_init(char *ident);
venaas's avatar
venaas committed
24
void debug_set_level(uint8_t level);
25
void debug_timestamp_on();
26
uint8_t debug_get_level();
venaas's avatar
venaas committed
27
void debug(uint8_t level, char *format, ...);
28
void debugx(int status, uint8_t level, char *format, ...);
29 30
void debugerrno(int err, uint8_t level, char *format, ...);
void debugerrnox(int err, uint8_t level, char *format, ...);
31
int debug_set_destination(char *dest, int log_type);
32
void debug_reopen_log();
33 34 35
#if defined(WANT_FTICKS)
void fticks_debug(const char *format, ...);
#endif
36 37 38 39

/* Local Variables: */
/* c-file-style: "stroustrup" */
/* End: */