MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / handleLogOutput

Method handleLogOutput

src/debug/web_debug_impl.ts:122–143  ·  view source on GitHub ↗
(msg: string, forceErrorCategory = false)

Source from the content-addressed store, hash-verified

120 }
121
122 private handleLogOutput(msg: string, forceErrorCategory = false) {
123 msg = `${msg.trimRight()}\n`;
124 if (msg.includes(flutterExceptionStartBannerPrefix)) {
125 // Change before logging.
126 this.outputCategory = "stderr";
127 this.logToUser(msg, this.outputCategory);
128 } else if (msg.includes(flutterExceptionEndBannerPrefix)) {
129 // Log before changing back.
130 this.logToUser(msg, this.outputCategory);
131 this.outputCategory = "stdout";
132 } else {
133 this.logToUser(msg, forceErrorCategory ? "stderr" : this.outputCategory);
134 // This text comes through as stdout and not Progress, so map it over
135 // to progress indicator.
136 if (msg.includes("Waiting for connection from")) {
137 const instructions = "Please click the Dart Debug extension button in the spawned browser window";
138 this.updateProgress(debugLaunchProgressId, instructions);
139 // Send this delayed, so it appears after the rest of the help text.
140 setTimeout(() => this.logToUser(`${instructions}\n`, forceErrorCategory ? "stderr" : this.outputCategory), 10);
141 }
142 }
143 }
144
145 private async connectToVmServiceIfReady() {
146 if (this.vmServiceUri && this.appHasStarted && !this.vmService)

Callers 1

spawnProcessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected