Skip to content

Commit

Permalink
refactor: add a default logger for debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
sssooonnnggg committed Dec 18, 2024
1 parent d6a26bd commit ab34961
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions debugger/src/internal/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
namespace luau::debugger::log {
using Logger = std::function<void(std::string_view)>;
inline Logger& info() {
static Logger logger;
static Logger logger = [](std::string_vieww) { printf("%s", msg.data()); };
return logger;
}

inline Logger& error() {
static Logger logger;
static Logger logger = [](std::string_view) {
fprintf(stderr, "%s", msg.data());
};
return logger;
}

Expand Down

0 comments on commit ab34961

Please sign in to comment.