RealtimeLogManager
The real-time log manager instance, which can be obtained via Taro.getRealtimeLogManager
.
How to Use
To help mini program developers quickly troubleshoot mini program vulnerabilities and locate problems, we have introduced a real-time logging feature. Starting from Foundation 2.7.1, developers can print logs through the interface provided, and the logs will be aggregated and reported to the mini program backend in real time.
Developers can access the log query page on the mini program side from "Development->Operation and Maintenance Centre->Real-time Log" in the mini program management backend, or from "mini program Plug-in->Real-time Log" to view the log information printed by developers.
Methods
addFilterMsg
Add filter keywords.
(msg: string) => void
Property | Type | Description |
---|---|---|
msg | string | Parameter to setFilterMsg , used to set multiple filter keywords. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.addFilterMsg | ✔️ |
error
Writes the "error" log.
(...args: any[]) => void
Property | Type | Description |
---|---|---|
args | any[] | The log can contain any number of entries, but the total size of the parameters of a single call cannot exceed 5 KB. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.error | ✔️ |
in
Set the page where the live log page parameter is located
(pageInstance: any) => void
Property | Type |
---|---|
pageInstance | page instance |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.in | ✔️ |
info
Writes the "info" log.
(...args: any[]) => void
Property | Type | Description |
---|---|---|
args | any[] | The log can contain any number of entries, but the total size of the parameters of a single call cannot exceed 5 KB. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.info | ✔️ |
setFilterMsg
Set filter keywords
(msg: string) => void
Property | Type | Description |
---|---|---|
msg | string | Filter keywords of no more than 1KB can be searched in the mini program administration backend to get the corresponding logs based on the content set. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.setFilterMsg | ✔️ |
warn
Writes the "warn" log.
(...args: any[]) => void
Property | Type | Description |
---|---|---|
args | any[] | The log can contain any number of entries, but the total size of the parameters of a single call cannot exceed 5 KB. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.warn | ✔️ |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
RealtimeLogManager.addFilterMsg | ✔️ | ||
RealtimeLogManager.error | ✔️ | ||
RealtimeLogManager.in | ✔️ | ||
RealtimeLogManager.info | ✔️ | ||
RealtimeLogManager.setFilterMsg | ✔️ | ||
RealtimeLogManager.warn | ✔️ |