1 /*
2     This file is part of GNU APL, a free implementation of the
3     ISO/IEC Standard 13751, "Programming Language APL, Extended"
4 
5     Copyright (C) 2008-2015  Dr. Jürgen Sauermann
6 
7     This program is free software: you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation, either version 3 of the License, or
10     (at your option) any later version.
11 
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License
18     along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef __LOGGING_HH_DEFINED__
22 #define __LOGGING_HH_DEFINED__
23 
24 #include "Common.hh"
25 
26 enum LogId
27 {
28    LID_NONE = 0,
29 #define log_def(val, item, txt) LID_ ## item,
30 #include "Logging.def"
31    LID_MAX,
32    LID_MIN = LID_NONE + 1,
33 };
34 
35 #ifdef DYNAMIC_LOG_WANTED
36 
37 #define log_def(val, item, txt) extern bool LOG_ ## item;
38 #include "Logging.def"
39 
40 void Log_control(LogId lid, bool ON);
41 bool Log_status(LogId lid);
42 const char * Log_info(LogId lid);
43 
44 #else   // static logging
45 
46 #define Log_control(x, y)
47 #define log_def(val, item, txt) enum { LOG_ ## item = val };
48 #include "Logging.def"
49 
50 #endif
51 
52 /// Shortcut for the selected logging option.
53 #define Log(x) if (x)
54 
55 #endif // __LOGGING_HH_DEFINED__
56 
57