MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / console_message_from_log_entry

Function console_message_from_log_entry

py/private/_script_handlers.py:173–187  ·  view source on GitHub ↗

Build a :class:`ConsoleMessage` from raw ``log.entryAdded`` params.

(params: dict)

Source from the content-addressed store, hash-verified

171
172
173def console_message_from_log_entry(params: dict) -> ConsoleMessage:
174 """Build a :class:`ConsoleMessage` from raw ``log.entryAdded`` params."""
175 frames = _stack_frames(params.get("stackTrace"))
176 top = frames[0] if frames else {}
177 return ConsoleMessage(
178 level=params.get("level"),
179 text=params.get("text"),
180 source=top.get("url"),
181 line_number=top.get("lineNumber"),
182 column_number=top.get("columnNumber"),
183 stack_trace=_format_stack_trace(params.get("stackTrace")),
184 timestamp=params.get("timestamp"),
185 method=params.get("method"),
186 args=params.get("args"),
187 )
188
189
190def script_error_from_log_entry(params: dict) -> ScriptError:

Callers 1

_dispatchMethod · 0.85

Calls 4

ConsoleMessageClass · 0.90
_stack_framesFunction · 0.85
_format_stack_traceFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected