src/util/log.cpp File Reference

#include "util/log.hpp"
#include <iostream>
#include "math/rectf.hpp"
#include "supertux/console.hpp"

Go to the source code of this file.

Functions

static std::ostream & get_logging_instance (void)
static std::ostream & log_generic_f (const char *prefix, const char *file, int line)
std::ostream & log_debug_f (const char *file, int line)
std::ostream & log_info_f (const char *file, int line)
std::ostream & log_warning_f (const char *file, int line)
std::ostream & log_fatal_f (const char *file, int line)
std::ostream & operator<< (std::ostream &out, const Vector &vector)
std::ostream & operator<< (std::ostream &out, const Rectf &rect)


Function Documentation

static std::ostream& get_logging_instance ( void   )  [static]

Definition at line 25 of file log.cpp.

References Console::instance, and Console::output.

Referenced by log_generic_f().

00026 {
00027   if (Console::instance != NULL)
00028     return (Console::output);
00029   else
00030     return (std::cerr);
00031 }

std::ostream& log_debug_f ( const char *  file,
int  line 
)

Definition at line 39 of file log.cpp.

References log_generic_f().

00040 {
00041   return (log_generic_f ("[DEBUG]", file, line));
00042 }

std::ostream& log_fatal_f ( const char *  file,
int  line 
)

Definition at line 54 of file log.cpp.

References log_generic_f().

00055 {
00056   return (log_generic_f ("[FATAL]", file, line));
00057 }

static std::ostream& log_generic_f ( const char *  prefix,
const char *  file,
int  line 
) [static]

Definition at line 33 of file log.cpp.

References get_logging_instance().

Referenced by log_debug_f(), log_fatal_f(), log_info_f(), and log_warning_f().

00034 {
00035   get_logging_instance () << prefix << " " << file << ":" << line << " ";
00036   return (get_logging_instance ());
00037 }

std::ostream& log_info_f ( const char *  file,
int  line 
)

Definition at line 44 of file log.cpp.

References log_generic_f().

00045 {
00046   return (log_generic_f ("[INFO]", file, line));
00047 }

std::ostream& log_warning_f ( const char *  file,
int  line 
)

Definition at line 49 of file log.cpp.

References log_generic_f().

00050 {
00051   return (log_generic_f ("[WARNING]", file, line));
00052 }

std::ostream& operator<< ( std::ostream &  out,
const Rectf rect 
)

Definition at line 65 of file log.cpp.

References Rectf::get_bottom(), Rectf::get_left(), Rectf::get_right(), and Rectf::get_top().

00066 {
00067   out << "[" << rect.get_left() << "," << rect.get_top() << "   "
00068       << rect.get_right() << "," << rect.get_bottom() << "]";
00069   return out;
00070 }

std::ostream& operator<< ( std::ostream &  out,
const Vector vector 
)

Definition at line 59 of file log.cpp.

00060 {
00061   out << '[' << vector.x << ',' << vector.y << ']';
00062   return out;
00063 }


Generated on Mon Apr 21 03:38:20 2014 for SuperTux by  doxygen 1.5.1