Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Suggestion
Splitting out of#5834 (comment):
in an ideal world we'd actually do a unique substring per file to help differentiate where logs are coming from.
eg
typescript-eslint:typescript-estree:inferSingleRun
,typescript-eslint:typescript-estree:create-program:useProvidedPrograms
, etcthis also allows you to easily filter the log lines to specific usecases with env vars like
DEBUG=typescript-eslint:typescript-estree:create-program:*
also helpful because
debug
also colours each string differently IIRC so it's easy to see different sources when parsing logs.I wonder if we can automate creation of the string via like
constPACKAGE_ROOT="resolve from disk somehow";functiongetLogger(filename:string){constrelative=path.relative(PACKAGE_ROOT,filename);constparsed=path.parse(relative);returndebug(`typescript-eslint:${parsed.dir.replace(/\//g,':')}:${parsed.name}`);}// then call this viaconstlog=getLogger(__filename);
It'd be nifty if we could use a lint rule that enforces such a thing.