Skip to content

Commit

Permalink
Add more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannmoinet committed Feb 21, 2025
1 parent e957f4c commit 128fab1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/plugins/analytics/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# Analytics Plugin <!-- #omit in toc -->

Send some analytics data to Datadog internally.

It gives you acces to the `context.sendLog()` function.

```typescript
// Send a basic log.
context.sendLog('My basic log');

// Send some context with the log.
context.sendLog('My contextual log', { some: 'context' });
```

Every log already has some context to it:

```typescript
{
ddsource: string; // Name of the bundler plugin (e.g. `@datadog/webpack-plugin`).
env: Env; // Environment (e.g. `production`).
message; // The log message.
service: 'build-plugins';
bundler: {
name: string; // Name of the bundler (e.g. `webpack`).
version: string; // Version of the bundler.
};
plugins: PluginName[]; // List of the plugins/features enabled.
version: string; // Version of the plugin.
}
```

0 comments on commit 128fab1

Please sign in to comment.