Euphoria
log.cc
Go to the documentation of this file.
1 #include "window/log.h"
2 
3 #include "SDL.h"
4 
5 
6 namespace eu::window
7 {
8 
9 // todo(Gustav) : extend api to supply categories?
10 /*
11 SDL_LOG_CATEGORY_APPLICATION,
12 SDL_LOG_CATEGORY_ERROR,
13 SDL_LOG_CATEGORY_ASSERT,
14 SDL_LOG_CATEGORY_SYSTEM,
15 SDL_LOG_CATEGORY_AUDIO,
16 SDL_LOG_CATEGORY_VIDEO,
17 SDL_LOG_CATEGORY_RENDER,
18 SDL_LOG_CATEGORY_INPUT,
19 SDL_LOG_CATEGORY_TEST
20 
21 SDL_LOG_CATEGORY_CUSTOM...
22 */
23 
24 void generic_log(SDL_LogPriority prio, const std::string& str)
25 {
26  SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, prio, "%s", str.c_str());
27 }
28 
29 void SdlLogger::info(const std::string& str)
30 {
31  generic_log(SDL_LOG_PRIORITY_INFO, str);
32 }
33 
34 void SdlLogger::warn(const std::string& str)
35 {
36  generic_log(SDL_LOG_PRIORITY_WARN, str);
37 }
38 
39 void SdlLogger::error(const std::string& str)
40 {
41  generic_log(SDL_LOG_PRIORITY_ERROR, str);
42 }
43 
44 
45 }
46 
void generic_log(SDL_LogPriority prio, const std::string &str)
Definition: log.cc:24
void error(const std::string &str) override
Definition: log.cc:39
void info(const std::string &str) override
Definition: log.cc:29
void warn(const std::string &str) override
Definition: log.cc:34