Loading...
Searching...
No Matches
ConsoleMessage.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * This file is a part of Ultralight. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2024 Ultralight, Inc. *
7 **************************************************************************************************/
8#pragma once
10#include <Ultralight/String.h>
12
13namespace ultralight {
14
15///
16/// MessageSource types
17///
37
54
55///
56/// MessageLevel types
57///
65
66///
67/// @brief Interface for console messages.
68///
70 public:
71 virtual ~ConsoleMessage() = default;
72
73 ///
74 /// The source of the message.
75 ///
76 virtual MessageSource source() const = 0;
77
78 ///
79 /// The type of content displayed.
80 ///
81 virtual MessageType type() const = 0;
82
83 ///
84 /// The log level for the message.
85 ///
86 virtual MessageLevel level() const = 0;
87
88 ///
89 /// The message as a string-- for multi-argument calls to console.log() this just converts the
90 /// first parameter to a string.
91 ///
92 virtual String message() const = 0;
93
94 ///
95 /// The line number of the JavaScript associated with this call, if any.
96 ///
97 virtual uint32_t line_number() const = 0;
98
99 ///
100 /// The column number of the JavaScript associated with this call, if any.
101 ///
102 virtual uint32_t column_number() const = 0;
103
104 ///
105 /// The source id (eg, URL) of the page associated with this call, if any.
106 ///
107 virtual String source_id() const = 0;
108
109 ///
110 /// The JavaScript execution context for the arguments, if any.
111 ///
112 virtual JSContextRef argument_context() const = 0;
113
114 ///
115 /// The number of JavaScript arguments passed to console.log(), if any.
116 ///
117 virtual uint32_t num_arguments() const = 0;
118
119 ///
120 /// Get the JavaScript argument at a specific index (numbering starts at 0).
121 ///
122 virtual JSValueRef argument_at(uint32_t idx) const = 0;
123};
124
125} // namespace ultralight
#define UExport
Definition Exports.h:25
const struct OpaqueJSValue * JSValueRef
Definition JSBase.h:66
const struct OpaqueJSContext * JSContextRef
Definition JSBase.h:43
Interface for console messages.
Definition ConsoleMessage.h:69
virtual MessageType type() const =0
The type of content displayed.
virtual String message() const =0
The message as a string– for multi-argument calls to console.log() this just converts the first param...
virtual uint32_t column_number() const =0
The column number of the JavaScript associated with this call, if any.
virtual MessageLevel level() const =0
The log level for the message.
virtual uint32_t line_number() const =0
The line number of the JavaScript associated with this call, if any.
virtual ~ConsoleMessage()=default
virtual MessageSource source() const =0
The source of the message.
virtual JSContextRef argument_context() const =0
The JavaScript execution context for the arguments, if any.
virtual JSValueRef argument_at(uint32_t idx) const =0
Get the JavaScript argument at a specific index (numbering starts at 0).
virtual String source_id() const =0
The source id (eg, URL) of the page associated with this call, if any.
virtual uint32_t num_arguments() const =0
The number of JavaScript arguments passed to console.log(), if any.
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition String.h:34
Definition App.h:14
MessageSource
MessageSource types.
Definition ConsoleMessage.h:18
@ kMessageSource_CSS
Definition ConsoleMessage.h:26
@ kMessageSource_JS
Definition ConsoleMessage.h:20
@ kMessageSource_Network
Definition ConsoleMessage.h:21
@ kMessageSource_Media
Definition ConsoleMessage.h:29
@ kMessageSource_PaymentRequest
Definition ConsoleMessage.h:34
@ kMessageSource_AppCache
Definition ConsoleMessage.h:24
@ kMessageSource_WebRTC
Definition ConsoleMessage.h:31
@ kMessageSource_ContentBlocker
Definition ConsoleMessage.h:28
@ kMessageSource_MediaSource
Definition ConsoleMessage.h:30
@ kMessageSource_ITPDebug
Definition ConsoleMessage.h:32
@ kMessageSource_XML
Definition ConsoleMessage.h:19
@ kMessageSource_Rendering
Definition ConsoleMessage.h:25
@ kMessageSource_Security
Definition ConsoleMessage.h:27
@ kMessageSource_Storage
Definition ConsoleMessage.h:23
@ kMessageSource_ConsoleAPI
Definition ConsoleMessage.h:22
@ kMessageSource_Other
Definition ConsoleMessage.h:35
@ kMessageSource_PrivateClickMeasurement
Definition ConsoleMessage.h:33
MessageLevel
MessageLevel types.
Definition ConsoleMessage.h:58
@ kMessageLevel_Debug
Definition ConsoleMessage.h:62
@ kMessageLevel_Warning
Definition ConsoleMessage.h:60
@ kMessageLevel_Info
Definition ConsoleMessage.h:63
@ kMessageLevel_Error
Definition ConsoleMessage.h:61
@ kMessageLevel_Log
Definition ConsoleMessage.h:59
MessageType
Definition ConsoleMessage.h:38
@ kMessageType_Assert
Definition ConsoleMessage.h:48
@ kMessageType_Log
Definition ConsoleMessage.h:39
@ kMessageType_ProfileEnd
Definition ConsoleMessage.h:51
@ kMessageType_Table
Definition ConsoleMessage.h:42
@ kMessageType_Timing
Definition ConsoleMessage.h:49
@ kMessageType_Trace
Definition ConsoleMessage.h:43
@ kMessageType_Dir
Definition ConsoleMessage.h:40
@ kMessageType_Clear
Definition ConsoleMessage.h:47
@ kMessageType_DirXML
Definition ConsoleMessage.h:41
@ kMessageType_StartGroupCollapsed
Definition ConsoleMessage.h:45
@ kMessageType_EndGroup
Definition ConsoleMessage.h:46
@ kMessageType_StartGroup
Definition ConsoleMessage.h:44
@ kMessageType_Image
Definition ConsoleMessage.h:52
@ kMessageType_Profile
Definition ConsoleMessage.h:50