0.1.4 • Published 3 years ago

collect-logs v0.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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
0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago