-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.repo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs
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
const PACKAGE_ROOT = "resolve from disk somehow"; function getLogger(filename: string) { const relative = path.relative(PACKAGE_ROOT, filename); const parsed = path.parse(relative); return debug(`typescript-eslint:${parsed.dir.replace(/\//g, ':')}:${parsed.name}`); } // then call this via const log = getLogger(__filename);
It'd be nifty if we could use a lint rule that enforces such a thing.
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.repo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs