Debian Codegraph @

Kernel/LeveLogger.h

raw symbols SCIP
1 /* This file is part of the FaCT++ DL reasoner
2 Copyright (C) 2003-2015 Dmitry Tsarkov and The University of Manchester
3 Copyright (C) 2015-2017 Dmitry Tsarkov
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #ifndef LEVELOGGER_H
21 #define LEVELOGGER_Hcxx . . $ `Kernel/LeveLogger.h:21:9`!
22
23 #include <iosfwd>
24
25 #include "globaldef.h"cxx . . $ `<file>/Kernel/globaldef.h`/
26
27 class Configurationcxx . . $ Configuration#;
28
29 class LeveLoggercxx . . $ LeveLogger#
30 {
31 private: // members
32 /// the allowed logging level; init it once for the whole session
33 unsigned int allowedLevelcxx . . $ LeveLogger#allowedLevel. = 0;
34
35 public: // interface
36 /// sets output file and allowedLevel by given values
37 bool initLoggercxx . . $ LeveLogger#initLogger(33974edd1b6ef6cc). ( unsigned int l, const char* filename );
38 /** sets output file and allowedLevel by config file.
39 * The values will be taken from Config|[LeveLogger]|{allowedLevel,file}
40 * Default level is 0, but the file name is mandatory.
41 */
42 bool initLoggercxx . . $ LeveLogger#initLogger(4977eee16444659f). ( Configurationcxx . . $ Configuration#& Config );
43
44 /// @return true if LEVEL will be allowed
45 bool isWritablecxx . . $ LeveLogger#isWritable(8de63fdb265b07c1). ( unsigned int level ) const
46 {
47 if ( USE_LOGGINGcxx . . $ `Kernel/globaldef.h:45:10`! )
48 return level <= allowedLevelcxx . . $ LeveLogger#allowedLevel.;
49 else
50 return false;
51 }
52 }; // LeveLogger
53
54 /// the only main logger/manager for all usage
55 extern LeveLoggercxx . . $ LeveLogger# LLMcxx . . $ LLM.;
56 /// file stream to be used by LLM; be sure that every OP with LL is guarded by LLM
57 extern stdcxx . . $ std/::ostreamcxx . . $ std/ostream#& LLcxx . . $ LL.;
58
59 // macro for checking if LL is writable and then return
60 #define CHECK_LL_RETURNcxx . . $ `Kernel/LeveLogger.h:60:9`!(val) \
61 if (!LLM.isWritable(val)) return
62
63 // macro for checking if LL is writable and then return value
64 #define CHECK_LL_RETURN_VALUEcxx . . $ `Kernel/LeveLogger.h:64:9`!(val,ret) \
65 if (!LLM.isWritable(val)) return (ret)
66
67 #endif // LEVELOGGER_H