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 
22 #include "Logging.hh"
23 
24 #ifdef DYNAMIC_LOG_WANTED
25 
26 #define log_def(val, item, txt) bool LOG_ ## item = val;
27 #include "Logging.def"
28 
29 void
Log_control(LogId lid,bool ON)30 Log_control(LogId lid, bool ON)
31 {
32    switch(lid)
33       {
34 #define log_def(val, item, txt) case LID_ ## item: LOG_ ## item = ON; return;
35 #include "Logging.def"
36 
37         default: break;
38       }
39 }
40 
41 bool
Log_status(LogId lid)42 Log_status(LogId lid)
43 {
44    switch(lid)
45       {
46 #define log_def(val, item, txt) case LID_ ## item: return LOG_ ## item;
47 #include "Logging.def"
48 
49         default: break;
50       }
51 
52    return false;
53 }
54 
55 const char *
Log_info(LogId lid)56 Log_info(LogId lid)
57 {
58    switch(lid)
59       {
60 #define log_def(val, item, txt) case LID_ ## item: return txt;
61 #include "Logging.def"
62 
63         default: break;
64       }
65 
66    return 0;
67 }
68 
69 #endif
70 
71