/*!
 *        /\         +------------------------------------------------------+
 *   ____/  \____   /| - Open source game framework licensed to freely use, |
 *   \          /  / |   copy, modify and sell without restriction          |
 * +--\ ^__^   /--+  |                                                      |
 * | ~/        \~ |  | - created for              |
 * | ~~~~~~~~~~~~ |  +------------------------------------------------------+
 * | SPACE ~~~~~  | /
 * |  ~~~~~~~ BOX |/
 * +--------------+                                                    
* * Log * === * * Log messages of specified priority through the SDL logging method, which is overridden in * the Game class to write to stdout, file, or both, depending on the user's configuration * settings. */ #ifndef SB_LOG_H_ #define SB_LOG_H_ /* include Open GL */ #if defined(__EMSCRIPTEN__) #include #elif defined(__ANDROID__) && defined(ANDROID) #include #include #else #include "glew/glew.h" #endif #include #include #include #include /* #include "filesystem.hpp" */ namespace sb { class Log { public: /* These definitions are equivalent to SDL's SDL_LOG_PRIORITY_* values */ enum Level { VERBOSE = 1, DEBUG, INFO, WARN, ERROR, CRITICAL, }; static const int DEFAULT_CATEGORY = SDL_LOG_CATEGORY_CUSTOM; Log(std::function); static void log(const std::string&, const Level = INFO, const int = DEFAULT_CATEGORY); static void log(const std::ostringstream&, const Level = INFO, const int = DEFAULT_CATEGORY); static bool gl_errors(const std::string& = ""); static void sdl_error(const std::string&); /* static void record(void*, int, SDL_LogPriority, const char*); */ }; /* Log log = Log(&Log::record); */ } #endif