0.1.4 • Published 2 years ago

collect-logs v0.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 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

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago