update plugin docs
This commit is contained in:
@@ -45,13 +45,13 @@ rrweb.record({
|
||||
});
|
||||
```
|
||||
|
||||
All recordLog options are described below:
|
||||
| key | default | description |
|
||||
All options are described below:
|
||||
| key | default | description |
|
||||
| ---------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| level | ['log','warn','error',...] | Default value contains names of all console functions. You can override it by setting console levels you need. |
|
||||
| lengthThreshold | 1000 | Maximum number of records of console output. |
|
||||
| level | ['log','warn','error',...] | Default value contains names of all console functions. You can override it by setting console levels you need. |
|
||||
| lengthThreshold | 1000 | Maximum number of records of console output. |
|
||||
| stringifyOptions | { stringLengthLimit: undefined, numOfKeysLimit: 50, depthOfLimit: 4 } | If console output includes js objects, we need to stringify them. `stringLengthLimit` limits the string length of single value. `numOfKeysLimit` limits the number of keys in an object. `depthOfLimit` limits the depth of object. If an object contains more keys than this limit, we would only save object's name. You can reduce the size of events by setting these options. |
|
||||
| logger | window.console | the console object we would record.You can set a console object from another execution environment where you would like to record. |
|
||||
| logger | window.console | the console object we would record.You can set a console object from another execution environment where you would like to record. |
|
||||
|
||||
## replay console
|
||||
|
||||
@@ -70,7 +70,7 @@ replayer.play();
|
||||
|
||||
Description of replay option is as follows:
|
||||
|
||||
| key | default | description |
|
||||
| ------------ | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| level | ['log','warn','error',...] | Same meaning as that option in recordLog. You can set this option to play levels of log you need. |
|
||||
| key | default | description |
|
||||
| ------------ | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| level | ['log','warn','error',...] | You can set this option to play levels of log you need. |
|
||||
| replayLogger | a console based object that implements the interface [ReplayLogger](../../packages/rrweb/src/plugins/console/replay/index.ts#L13) | You can also set a replay logger to replay the log messages in a simulated browser console by implementing the interface `ReplayLogger` |
|
||||
|
||||
@@ -45,12 +45,12 @@ rrweb.record({
|
||||
```
|
||||
|
||||
如下是配置选项的详细说明:
|
||||
| key | 默认值 | 功能 |
|
||||
| key | 默认值 | 功能 |
|
||||
| ---------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| level | ['log','warn','error',...] | 默认值包含了 console 的全部函数,你也可以传入想要录制的 console 函数。 |
|
||||
| lengthThreshold | 1000 | 录制 console 输出信息的最大条数。 |
|
||||
| level | ['log','warn','error',...] | 默认值包含了 console 的全部函数,你也可以传入想要录制的 console 函数。 |
|
||||
| lengthThreshold | 1000 | 录制 console 输出信息的最大条数。 |
|
||||
| stringifyOptions | { stringLengthLimit: undefined, numOfKeysLimit: 50, depthOfLimit: 4 } | 如果 console 输出包含了 js 对象,我们需要对其进行序列化,`stringLengthLimit` 限制了单个值能转化的最大字符串长度,`numOfKeysLimit` 限制了一个被序列化的 js 对象能够包含的最大数量 key,`depthOfLimit` 限制了一个被序列化的 js 对象能够拥有的对象深度(层数),如果对象的 key 数量超过了这个限制,我们将只保留对象的名字。你能通过这些选项来减小生成的 events 的体积。 |
|
||||
| logger | window.console | 要录制的 console 对象,你也可以传入一个想要录制的其他 js 执行环境的 console 对象。 |
|
||||
| logger | window.console | 要录制的 console 对象,你也可以传入一个想要录制的其他 js 执行环境的 console 对象。 |
|
||||
|
||||
## 播放 console 数据
|
||||
|
||||
@@ -69,7 +69,7 @@ replayer.play();
|
||||
|
||||
如下是对 replay 选项的描述:
|
||||
|
||||
| key | 默认值 | 功能 |
|
||||
| ------------ | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| level | ['log','warn','error',...] | 与 recordLog 设置选项的含义相同,你可以只播放想要的 console 函数类型 |
|
||||
| key | 默认值 | 功能 |
|
||||
| ------------ | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| level | ['log','warn','error',...] | 你可以只播放想要的 console 函数类型 |
|
||||
| replayLogger | 一个基于 console 的对接口[ReplayLogger](../../packages/rrweb/src/plugins/console/replay/index.ts#L13)的实现 | 你也可以通过传入一个`ReplayLogger`接口的自己的实现,用 html 模拟一个浏览器控制台,来播放录制的 console 数据 |
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
The plugin API is designed to extend the function of rrweb without bump the size and complexity of rrweb's core part.
|
||||
|
||||
# Available plugins
|
||||
|
||||
- [console](./console.md)
|
||||
|
||||
## Interface
|
||||
|
||||
Same to with other functionality in rrweb, a plugin can implement record or replay or both features.
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
插件 API 的设计目标是在不增加 rrweb 核心部分大小和复杂性的前提下,扩展 rrweb 的功能。
|
||||
|
||||
# 可用插件
|
||||
|
||||
- [console](./console.zh_CN.md)
|
||||
|
||||
## 接口
|
||||
|
||||
与 rrweb 其它功能相似,插件可以包含同时包含录制、回放侧的功能,也可以只实现其中任一。
|
||||
|
||||
Reference in New Issue
Block a user