Skip to content

Commit

Permalink
[ref] tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MrsRina committed Feb 25, 2025
1 parent f233d23 commit e5035c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/ekg/io/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <iostream>
#include <sstream>

#define EKG_LOG_DEBUG

namespace ekg {
class log {
public:
Expand Down Expand Up @@ -41,6 +43,11 @@ namespace ekg {
std::terminate();
}
}
public:
template<typename t>
explicit log(t content) {
std::cout << content << std::endl;
}

explicit log() {
ekg::log::buffered = true;
Expand All @@ -49,11 +56,9 @@ namespace ekg {

~log() {
ekg::log::buffer << '\n';
//#define EKG_LOG_DEBUG
#ifdef EKG_LOG_DEBUG
ekg::log::buffered = true;
ekg::log::flush();
ekg_log("");
#endif
}

Expand Down Expand Up @@ -100,4 +105,4 @@ namespace ekg {
);
}

#endif
#endif
3 changes: 3 additions & 0 deletions test/src/ekg_gui_showcase_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
application_t app {};

int32_t main(int32_t, char**) {
ekg::log("blalblla");
ekg::log(2);

SDL_Init(SDL_INIT_VIDEO);

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
Expand Down

0 comments on commit e5035c7

Please sign in to comment.