| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef _LOG_H_ |
| 21 |
#define _LOG_H_ |
| 22 |
|
| 23 |
time_t get_current_time(void); |
| 24 |
double get_current_time_exact(void); |
| 25 |
|
| 26 |
extern char current_date[50]; |
| 27 |
char* get_current_date(void); |
| 28 |
|
| 29 |
enum output_types { OUTPUT_TYPE_DEBUG, OUTPUT_TYPE_CONNECT, OUTPUT_TYPE_INFO, OUTPUT_TYPE_ERROR }; |
| 30 |
extern int debug_mode; |
| 31 |
extern int output_type; |
| 32 |
|
| 33 |
#ifndef __GNUC__ |
| 34 |
# define __attribute__(x) |
| 35 |
#endif |
| 36 |
|
| 37 |
void logging_init(int portnum); |
| 38 |
void l_(int wanted_output_type, char* file, long line, const char* func, char* fmt, ...) __attribute__((format(printf,5,6))); |
| 39 |
|
| 40 |
#define l0(wanted_output_type, f) l_(wanted_output_type, __FILE__, (long) __LINE__, __func__, f) |
| 41 |
#define l1(wanted_output_type, f, a1) l_(wanted_output_type, __FILE__, (long) __LINE__, __func__, f, a1) |
| 42 |
#define l2(wanted_output_type, f, a1, a2) l_(wanted_output_type, __FILE__, (long) __LINE__, __func__, f, a1, a2) |
| 43 |
#define l3(wanted_output_type, f, a1, a2, a3) l_(wanted_output_type, __FILE__, (long) __LINE__, __func__, f, a1, a2, a3) |
| 44 |
#define l4(wanted_output_type, f, a1, a2, a3, a4) l_(wanted_output_type, __FILE__, (long) __LINE__, __func__, f, a1, a2, a3, a4) |
| 45 |
|
| 46 |
#endif |