Skip to content

Commit

Permalink
src: expose WriteNodeReport to embedders
Browse files Browse the repository at this point in the history
Refs electron/electron#43774

Allows creating Node.js diagnostic reports from Electron signal handlers.
Currently used by Utility process to support error event.
  • Loading branch information
codebytere committed Sep 23, 2024
1 parent 2cec716 commit 76a7ec4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ using v8::Value;

namespace report {
// Internal/static function declarations
static void WriteNodeReport(Isolate* isolate,
Environment* env,
const char* message,
const char* trigger,
const std::string& filename,
std::ostream& out,
Local<Value> error,
bool compact,
bool exclude_network = false);
static void PrintVersionInformation(JSONWriter* writer,
bool exclude_network = false);
static void PrintJavaScriptErrorStack(JSONWriter* writer,
Expand All @@ -87,7 +78,7 @@ static void PrintNetworkInterfaceInfo(JSONWriter* writer);

// Internal function to coordinate and write the various
// sections of the report to the supplied stream
static void WriteNodeReport(Isolate* isolate,
void WriteNodeReport(Isolate* isolate,
Environment* env,
const char* message,
const char* trigger,
Expand Down
9 changes: 9 additions & 0 deletions src/node_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ std::string ValueToHexString(T value) {
// Function declarations - export functions in src/node_report_module.cc
void WriteReport(const v8::FunctionCallbackInfo<v8::Value>& info);
void GetReport(const v8::FunctionCallbackInfo<v8::Value>& info);
void WriteNodeReport(v8::Isolate* isolate,
Environment* env,
const char* message,
const char* trigger,
const std::string& filename,
std::ostream& out,
v8::Local<v8::Value> error,
bool compact,
bool exclude_network = false);

} // namespace report
} // namespace node
Expand Down

0 comments on commit 76a7ec4

Please sign in to comment.