-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathConsole.h
More file actions
38 lines (30 loc) · 1.69 KB
/
Console.h
File metadata and controls
38 lines (30 loc) · 1.69 KB
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
#ifndef Console_h
#define Console_h
#include "Common.h"
#include "JSV8InspectorClient.h"
#include <string>
namespace tns {
class Console {
public:
static void Init(v8::Local<v8::Context> context);
static void AttachInspectorClient(v8_inspector::JsV8InspectorClient* inspector);
static void DetachInspectorClient();
private:
using ConsoleAPIType = v8_inspector::ConsoleAPIType;
static void AttachLogFunction(v8::Local<v8::Context> context, v8::Local<v8::Object> console, const std::string name, v8::FunctionCallback callback = Console::LogCallback);
static void LogCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
static void AssertCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
static void DirCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
static void TimeCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
static void TimeEndCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
static std::string BuildStringFromArgs(const v8::FunctionCallbackInfo<v8::Value>& args, int startingIndex = 0);
static const v8::Local<v8::String> BuildStringFromArg(v8::Local<v8::Context> context, const v8::Local<v8::Value>& val);
static const v8::Local<v8::String> TransformJSObject(v8::Local<v8::Object> object);
static ConsoleAPIType VerbosityToInspectorMethod(const std::string level);
static void SendToDevToolsFrontEnd(ConsoleAPIType method,
const v8::FunctionCallbackInfo<v8::Value>& args);
static void SendToDevToolsFrontEnd(v8::Isolate* isolate, ConsoleAPIType method, const std::string& msg);
static v8_inspector::JsV8InspectorClient* inspector;
};
}
#endif /* Console_h */