diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-10 00:06:03 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-12 00:55:46 +0100 |
commit | 2c84f6e75cc513fe6e958f0489d104ee883db232 (patch) | |
tree | a7e70744a9d17cec3433cdd040366d26e0575bbc /src/node_report.h | |
parent | 6edf88284b2ef522d2f073e66fa32e9cbe6fafd2 (diff) | |
download | android-node-v8-2c84f6e75cc513fe6e958f0489d104ee883db232.tar.gz android-node-v8-2c84f6e75cc513fe6e958f0489d104ee883db232.tar.bz2 android-node-v8-2c84f6e75cc513fe6e958f0489d104ee883db232.zip |
report: make more items programmatically accessible
Prefer structured output over stringified information
for libuv handles and the native stack trace.
PR-URL: https://github.com/nodejs/node/pull/26019
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_report.h')
-rw-r--r-- | src/node_report.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_report.h b/src/node_report.h index eb38bee8c6..c83c52eb39 100644 --- a/src/node_report.h +++ b/src/node_report.h @@ -54,7 +54,6 @@ void GetNodeReport(v8::Isolate* isolate, std::ostream& out); // Function declarations - utility functions in src/node_report_utils.cc -void ReportEndpoints(uv_handle_t* h, std::ostringstream& out); void WalkHandle(uv_handle_t* h, void* arg); std::string EscapeJsonChars(const std::string& str); @@ -157,6 +156,8 @@ class JSONWriter { state_ = kAfterValue; } + struct Null {}; // Usable as a JSON value. + private: template <typename T, typename test_for_number = typename std:: @@ -168,6 +169,7 @@ class JSONWriter { out_ << number; } + inline void write_value(Null null) { out_ << "null"; } inline void write_value(const char* str) { write_string(str); } inline void write_value(const std::string& str) { write_string(str); } |