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

Function attachLoggingWhenExtensionAvailable

src/test/helpers.ts:228–244  ·  view source on GitHub ↗
(attempt = 1)

Source from the content-addressed store, hash-verified

226}
227
228export function attachLoggingWhenExtensionAvailable(attempt = 1) {
229 if (logger && !(logger instanceof BufferedLogger)) {
230 console.warn("Logging was already set up!");
231 return;
232 }
233
234 if (setupTestLogging()) {
235 // console.log("Logging was configured!");
236 return;
237 }
238
239 if (attempt < 50) {
240 setTimeout(() => attachLoggingWhenExtensionAvailable(attempt + 1), 100);
241 } else {
242 console.warn(`Failed to set up logging after ${attempt} attempts`);
243 }
244}
245
246function setupTestLogging(): boolean {
247 const ext = vs.extensions.getExtension(dartCodeExtensionIdentifier)!;

Calls 2

setupTestLoggingFunction · 0.85
warnMethod · 0.65