Update: Translations from eints
[openttd-github.git] / src / script / api / script_log.hpp
blobcac45a306785742d0ba9b5b4cb889818c91fe6b8
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file script_log.hpp Everything to handle and issue log messages. */
10 #ifndef SCRIPT_LOG_HPP
11 #define SCRIPT_LOG_HPP
13 #include "script_object.hpp"
15 /**
16 * Class that handles all log related functions.
17 * @api ai game
19 class ScriptLog : public ScriptObject {
20 /* ScriptController needs access to Enum and Log, in order to keep the flow from
21 * OpenTTD core to script API clear and simple. */
22 friend class ScriptController;
24 public:
25 /**
26 * Print an Info message to the logs.
27 * @param message The message to log.
28 * @note Special characters such as U+0000-U+0019 and U+E000-U+E1FF are not supported and removed or replaced by a question mark. This includes newlines and tabs.
30 static void Info(const std::string &message);
32 /**
33 * Print a Warning message to the logs.
34 * @param message The message to log.
35 * @note Special characters such as U+0000-U+0019 and U+E000-U+E1FF are not supported and removed or replaced by a question mark. This includes newlines and tabs.
37 static void Warning(const std::string &message);
39 /**
40 * Print an Error message to the logs.
41 * @param message The message to log.
42 * @note Special characters such as U+0000-U+0019 and U+E000-U+E1FF are not supported and removed or replaced by a question mark. This includes newlines and tabs.
44 static void Error(const std::string &message);
46 private:
47 /**
48 * Internal command to log the message in a common way.
50 static void Log(ScriptLogTypes::ScriptLogType level, const std::string &message);
53 #endif /* SCRIPT_LOG_HPP */