* Default message string formatter. Tries to create a simple string, and * but if it can't it'll return a variable reference. * * Intentionally not async-await as it's a hot path in console logging.
(
thread: Thread,
args: ReadonlyArray<Cdp.Runtime.RemoteObject>,
includeStackInVariables = false,
)
| 81 | * Intentionally not async-await as it's a hot path in console logging. |
| 82 | */ |
| 83 | protected formatDefaultString( |
| 84 | thread: Thread, |
| 85 | args: ReadonlyArray<Cdp.Runtime.RemoteObject>, |
| 86 | includeStackInVariables = false, |
| 87 | ) { |
| 88 | const useMessageFormat = args.length > 1 && args[0].type === 'string'; |
| 89 | const formatResult = useMessageFormat |
| 90 | ? formatMessage(args[0].value, args.slice(1) as AnyObject[], messageFormatters) |
| 91 | : formatMessage('', args as AnyObject[], messageFormatters); |
| 92 | |
| 93 | const output = formatResult.result + '\n'; |
| 94 | |
| 95 | if (formatResult.usedAllSubs && !args.some(previewAsObject)) { |
| 96 | return { output }; |
| 97 | } else { |
| 98 | return this.formatComplexStringOutput(thread, output, args, includeStackInVariables); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | private async formatComplexStringOutput( |
| 103 | thread: Thread, |
nothing calls this directly
no test coverage detected