MCPcopy Index your code
hub / github.com/microsoft/playwright / constructor

Method constructor

packages/utils/debugLogger.ts:40–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 private _debuggers = new Map<string, debug.IDebugger>();
39
40 constructor() {
41 if (process.env.DEBUG_FILE) {
42 const ansiRegex = new RegExp([
43 '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
44 '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
45 ].join('|'), 'g');
46 const stream = fs.createWriteStream(process.env.DEBUG_FILE);
47 (debug as any).log = (data: string) => {
48 stream.write(data.replace(ansiRegex, ''));
49 stream.write('\n');
50 };
51 }
52 }
53
54 log(name: LogName, message: string | Error | object) {
55 let cachedDebugger = this._debuggers.get(name);

Callers

nothing calls this directly

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected