Debian Codegraph @

server/log.h

raw symbols SCIP
1 /*******************************************************************************
2 *
3 * Copyright (c) 2004 Guillaume Cottenceau
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2, as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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) /*nothing*/
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