0.1.4 • Published 2 years ago
collect-logs v0.1.4
collect-logs
collect-logs is used to collect web logs, and takes error as the time to trigger report.
Installation
use npm
npm install collect-logs
use yarn
yarn add collect-logs
use pnpm
pnpm add collect-logs
Usage
import {
configConsole,
createConsole,
useTable,
deleteTable,
} from 'collect-logs'
// when initializing the project
configConsole(
{
// if it is Vue
// app: app
report(data: any) {
// Called when an error occurs
console.log(data)
},
},
() => {
console.log(`初始配制完成`)
// useTable(`表名`)
// deleteTable(`表名`)
// const myConsole = createConsole(`my-console`)
// myConsole.log(`hello collect-logs`)
// output: [ 2022-07-12 10:25:05 ] LOG my-console hello collect-logs
}
)
API
- configConsole
- createConsole
- useTable
- deleteTable
Config
- app
- report
- disabled
- showConsole