-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConsole.h
More file actions
58 lines (45 loc) · 1.38 KB
/
Console.h
File metadata and controls
58 lines (45 loc) · 1.38 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef CONSOLE_H
#define CONSOLE_H
#include "native_api_util.h"
#ifdef TARGET_ENGINE_V8
#include <src/inspector/v8-console-message.h>
#endif
#ifdef TARGET_ENGINE_V8
#include <src/inspector/v8-console-message.h>
#endif
#ifdef TARGET_ENGINE_V8
typedef void (*ConsoleCallback)(napi_env env,
v8_inspector::ConsoleAPIType method,
const std::vector<v8::Local<v8::Value>>& args);
#else
typedef void (*ConsoleCallback)(napi_env env, napi_callback_info info);
#endif
namespace nativescript {
enum ConsoleLogType {
kConsoleLogTypeLog,
kConsoleLogTypeError,
kConsoleLogTypeWarn,
kConsoleLogTypeInfo,
kConsoleLogTypeAssert,
};
class Console {
public:
static JS_CLASS_INIT(Init);
static JS_METHOD(Constructor);
static JS_METHOD(Log);
static JS_METHOD(Time);
static JS_METHOD(TimeEnd);
static JS_METHOD(Dir);
static JS_METHOD(Trace);
#ifdef TARGET_ENGINE_V8
static int sendToDevToolsFrontEnd(napi_env env,
v8_inspector::ConsoleAPIType method,
napi_callback_info info);
static void sendToDevToolsFrontEnd(napi_env env,
v8_inspector::ConsoleAPIType method,
const std::string& args);
#endif
static ConsoleCallback m_callback;
};
} // namespace nativescript
#endif // CONSOLE_H