Debian Codegraph @

engine/core/util/log/logger.i

raw
1 /***************************************************************************
2 * Copyright (C) 2005-2019 by the FIFE team *
3 * http://www.fifengine.net *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2.1 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21
22 %module fife
23 %{
24 #include "util/log/logger.h"
25 %}
26 %include "modules.h"
27
28 namespace std {
29 %template(moduleVector) std::vector<logmodule_t>;
30 };
31
32 namespace FIFE {
33
34
35 class LogManager {
36 public:
37 enum LogLevel {
38 LEVEL_DEBUG = 0,
39 LEVEL_LOG = 1,
40 LEVEL_WARN = 2,
41 LEVEL_ERROR = 3
42 };
43 ~LogManager();
44
45 void log(LogLevel level, logmodule_t module, const std::string& msg);
46 void setLevelFilter(LogLevel level);
47 LogLevel getLevelFilter();
48
49 void addVisibleModule(logmodule_t module);
50 void removeVisibleModule(logmodule_t module);
51 void clearVisibleModules();
52 bool isVisible(logmodule_t module);
53
54 void setLogToPrompt(bool logtoprompt);
55 bool isLogToPrompt();
56
57 void setLogToFile(bool logtofile);
58 bool isLogToFile();
59 std::string getModuleName(logmodule_t module);
60
61 private:
62 LogManager();
63 };
64
65 class Logger {
66 public:
67 Logger(logmodule_t module);
68 ~Logger();
69 void log(LogManager::LogLevel level, const std::string& msg);
70 };
71 }