#include "atom/common/node_includes.h"
#include "tizen/common/application_data.h"
#include "tizen/common/command_line.h"
+#include <dlog.h>
namespace atom {
}
}
+void PWRT::Log(const std::string& message) {
+ std::string output = "[JS LOG] " + message;
+ dlog_print(DLOG_INFO, "WRT", output.c_str());
+}
+
// static
mate::Handle<PWRT> PWRT::Create(v8::Isolate* isolate) {
LOG(INFO) << "PWRT::Create";
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("getMessage", &PWRT::GetMessage)
.SetMethod("getPath", &PWRT::GetPath)
- .SetMethod("isTizenWebApp", &PWRT::isTizenWebApp);
+ .SetMethod("isTizenWebApp", &PWRT::isTizenWebApp)
+ .SetMethod("log", &PWRT::Log);
}
} // namespace api
process.stdout.write = process.stderr.write = streamWrite
}
+let {pwrt} = require('electron');
+console.log = console.error = console.warn = function(...args) {
+ pwrt.log(util.format(...args));
+};
+
// Don't quit on fatal error.
process.on('uncaughtException', function (error) {
// Do nothing if the user has a custom uncaught exception handler.