Skip to content

Commit

Permalink
Disable QuickJS since we don't need it yet
Browse files Browse the repository at this point in the history
  • Loading branch information
fpw committed Jul 15, 2020
1 parent ce583dc commit c59ab28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ fs::ofstream logFile;
bool toStdOut = false;

void log(const std::string format, va_list args) {
if (logFile) {
std::lock_guard<std::mutex> lock(logMutex);
std::lock_guard<std::mutex> lock(logMutex);

if (logFile) {
char buf[8192];
vsnprintf(buf, sizeof(buf), format.c_str(), args);

Expand All @@ -46,6 +46,7 @@ void log(const std::string format, va_list args) {
if (toStdOut) {
std::cout << logStr.str() << std::endl;
}
std::flush(logFile);
}
}

Expand Down Expand Up @@ -79,19 +80,13 @@ void logger::warn(const std::string format, ...) {
va_start(args, format);
log("w: " + format, args);
va_end(args);
if (logFile) {
std::flush(logFile);
}
}

void logger::error(const std::string format, ...) {
va_list args;
va_start(args, format);
log("e: " + format, args);
va_end(args);
if (logFile) {
std::flush(logFile);
}
}

void logger::log_info(bool enable, const char *file, const char *function, const int line, const char *format, ... ) {
Expand Down
4 changes: 4 additions & 0 deletions src/scripting/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace js {

Runtime::Runtime() {
/*
runtime = JS_NewRuntime();
if (!runtime) {
throw std::runtime_error("Couldn't initialize QuickJS");
Expand All @@ -32,11 +33,14 @@ Runtime::Runtime() {
if (!ctx) {
throw std::runtime_error("Couldn't create QuickJS context");
}
*/
}

Runtime::~Runtime() {
/*
JS_FreeContext(ctx);
JS_FreeRuntime(runtime);
*/
}

}

0 comments on commit c59ab28

Please sign in to comment.