-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e957f4c
commit 128fab1
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
``` |