educational-technology-collective / vscode-telemetry

A vscode extension for generating and exporting editor's telemetry data.
https://marketplace.visualstudio.com/items?itemName=educational-technology-collective.telemetry
MIT License
4 stars 1 forks source link

No events are logged or saved #2

Open zioalex opened 8 months ago

zioalex commented 8 months ago

I cannot see any events. This is my config:

    "telemetry.activeEvents": [

      {
        "name": "DocumentOpenEvent",
        "logWholeDocument": true
      },
      {
        "name": "DocumentChangeEvent",
        "logWholeDocument": true
      },
      {
        "name": "DocumentCloseEvent",
        "logWholeDocument": true
      },
      {
        "name": "DocumentSaveEvent",
        "logWholeDocument": true
      }
    ],
  "telemetry.exporters": [

    {
      "type": "console_exporter"
    },
    {
      "type": "file_exporter",
      "args": "/home/developer/telemetry.log"
    }
  ]

So I expect to see logs in the console like as well in the specified file...But nothing is showed. How can I debug it?

mengyanw commented 8 months ago

Hi @zioalex When using a file exporter we need to write the settings like this. This should fix the problem you encountered. I will write more documentation on this.

    {
      "type": "file_exporter",
      "args": {
        "path": "/home/developer/telemetry.log",
      }
    }
mengyanw commented 8 months ago

settings example updated dfed64b

mengyanw commented 8 months ago

@zioalex To see logs in the console please open the VS code developer tools (command + shift + p and then search for "toggle developer tools")

Screenshot 2023-12-07 at 2 03 46 PM
zioalex commented 8 months ago

Hi @mengyanw thanks for the update. I've tried as you suggested and noted that it is not considering the absolute path image

And in fact it tries to write in a folder that doesn't exist. image

Specifying a relative path work as expected.

mengyanw commented 8 months ago

@zioalex Due to the limitation of the vscode extension API, the extension only supports writing to files via relative paths for now. Please feel free to open a PR if you want to work on this feature to find a possible way to write to files via absolute paths!