Skip to content

Add diagnostic logging to ts-node #960

@cspotcode

Description

@cspotcode

Desired Behavior

ts-node has a flag that enables diagnostic logging from ts-node (not TypeScript) to either a file on disk or to stdout. ts-node's API allows passing a reportDiagnostic function that is called for all ts-node diagnostics, allowing even more customizable reporting. This should match the UX of TypeScript's own DiagnosticReporter hooks.

This will enable end-users to see how ts-node is parsing flags (e.g. if transpile-only is on or off), see when the Program is recreated, see how long TypeScript API calls take, see how the rootFiles array changes over time. We can also log non-fatal invariants, e.g. cases where we expect the typescript compiler to behave one way but it does something else. (for example, recreating the Program instance when nothing has changed)

Is this request related to a problem?

It might help solicit feedback for gnarly issues like #754

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions