[node] Output debug logs when a render test times out
This commit is contained in:
@@ -47,6 +47,7 @@ NAN_MODULE_INIT(NodeMap::Init) {
|
||||
Nan::SetPrototypeMethod(tpl, "load", Load);
|
||||
Nan::SetPrototypeMethod(tpl, "render", Render);
|
||||
Nan::SetPrototypeMethod(tpl, "release", Release);
|
||||
Nan::SetPrototypeMethod(tpl, "dumpDebugLogs", DumpDebugLogs);
|
||||
|
||||
constructor.Reset(tpl->GetFunction());
|
||||
Nan::Set(target, Nan::New("Map").ToLocalChecked(), tpl->GetFunction());
|
||||
@@ -327,6 +328,14 @@ void NodeMap::release() {
|
||||
map.reset(nullptr);
|
||||
}
|
||||
|
||||
NAN_METHOD(NodeMap::DumpDebugLogs) {
|
||||
auto nodeMap = Nan::ObjectWrap::Unwrap<NodeMap>(info.Holder());
|
||||
|
||||
if (!nodeMap->isValid()) return Nan::ThrowError(releasedMessage());
|
||||
|
||||
nodeMap->map->dumpDebugLogs();
|
||||
info.GetReturnValue().SetUndefined();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Instance
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
static NAN_METHOD(Load);
|
||||
static NAN_METHOD(Render);
|
||||
static NAN_METHOD(Release);
|
||||
static NAN_METHOD(DumpDebugLogs);
|
||||
|
||||
void startRender(std::unique_ptr<NodeMap::RenderOptions> options);
|
||||
void renderFinished();
|
||||
@@ -38,7 +39,6 @@ public:
|
||||
static std::unique_ptr<NodeMap::RenderOptions> ParseOptions(v8::Local<v8::Object>);
|
||||
static Nan::Persistent<v8::Function> constructor;
|
||||
|
||||
private:
|
||||
NodeMap(v8::Local<v8::Object>);
|
||||
~NodeMap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user