microsoft / Power-Fx

Power Fx low-code programming language
MIT License
3.19k stars 324 forks source link

Add telemetry helper #1124

Open MikeStall opened 1 year ago

MikeStall commented 1 year ago

For Check, Eval add a helper that accepts ILogger and captures (As appropriate):

Some optional additional information provided by host:

Also could apply this to LSP. Notably, we want:

See Fx test site for examples.

MikeStall commented 1 year ago

TBD whether we depend on ILogger directly, or introduce an interface. ILogger would add another dependency; so may be better to just define our own interface that is similar to ILogger.

MikeStall commented 1 year ago

Here's a proposal:

  1. Create a new class, CheckDiagnostics, with properties corresponding to items above.
  2. CheckResult then hold a single instance of this object. As Check does things (parse, eval, etc), if the object is available, fill out the properties on the object.
  3. The host can then log that object.