-
Notifications
You must be signed in to change notification settings - Fork 28.3k
/
node_report.h
56 lines (43 loc) · 1.56 KB
/
node_report.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef SRC_NODE_REPORT_H_
#define SRC_NODE_REPORT_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "node.h"
#include "node_buffer.h"
#include "uv.h"
#include "util.h"
#ifndef _WIN32
#include <sys/types.h>
#include <unistd.h>
#endif
#include <iomanip>
namespace node {
namespace report {
// Function declarations - functions in src/node_report.cc
std::string TriggerNodeReport(v8::Isolate* isolate,
Environment* env,
const char* message,
const char* trigger,
const std::string& name,
v8::Local<v8::Value> error);
void GetNodeReport(v8::Isolate* isolate,
Environment* env,
const char* message,
const char* trigger,
v8::Local<v8::Value> error,
std::ostream& out);
// Function declarations - utility functions in src/node_report_utils.cc
void WalkHandle(uv_handle_t* h, void* arg);
template <typename T>
std::string ValueToHexString(T value) {
std::stringstream hex;
hex << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex <<
value;
return hex.str();
}
// 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);
} // namespace report
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_NODE_REPORT_H_