3 // SuperTux Debug Helper Functions
4 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program 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
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 #ifndef __SUPERTUX_MSG_H__
21 #define __SUPERTUX_MSG_H__
26 #include "console.hpp"
32 inline std::ostream& log_debug_f(const char* file, int line) {
33 Console::output << "[DEBUG] " << file << ":" << line << " ";
34 return Console::output;
37 inline std::ostream& log_info_f(const char* file, int line) {
38 Console::output << "[INFO] " << file << ":" << line << " ";
39 return Console::output;
42 inline std::ostream& log_warning_f(const char* file, int line) {
43 Console::output << "[WARNING] " << file << ":" << line << " ";
44 return Console::output;
47 inline std::ostream& log_fatal_f(const char* file, int line) {
48 Console::output << "[FATAL] " << file << ":" << line << " ";
49 return Console::output;
54 #define log_debug log_debug_f(__FILE__, __LINE__)
55 #define log_info log_info_f(__FILE__, __LINE__)
56 #define log_warning log_warning_f(__FILE__, __LINE__)
57 #define log_fatal log_fatal_f(__FILE__, __LINE__)
63 inline std::ostream& log_warning_f() {
64 Console::output << "Warning: ";
65 return Console::output;
68 inline std::ostream& log_fatal_f() {
69 Console::output << "Fatal: ";
70 return Console::output;
75 #define log_debug if (0) std::cerr
76 #define log_info std::cout
77 #define log_warning log_warning_f()
78 #define log_fatal log_fatal_f()
83 std::ostream& operator<< (std::ostream& str, const Vector& vector);
85 std::ostream& operator<< (std::ostream& str, const Rect& rect);