1.0.0 • Published 3 years ago

react-lighthouse-error-log v1.0.0

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

react-lighthouse-error-log

A function which calls a lighthouse log api

Motivation

Instead of calling lighouse log api all the time. Why not to call one function which can manage all our work for logs.

Getting started

What you need before use ?

You need to register with this Light house portal http://lighthouse.itpathsolutions.com:9011/login. Then you need to add your project with in portal and get your Project Key and Deliverable Key. Now you have to put these keys into .env file into your peoject's root folder.

Installation

$ npm i react-lighthouse-error-log

ENV setup

.env

PROJECT_KEY=your project key
DELIVERABLE_KEY=your deliverable key

Usage

import Log from "react-lighthouse-error-log";

Example

import Log from "react-lighthouse-error-log";

const App = () => {

 try {
      throw Error("Error.")
    } catch (error) {
      Log({
        error
      }).then(res => {
      
      }).catch(err => {

      })
    }
	
};

Props

PropsDescriptionExample
errorError trace object
logTypeThe value can be 1 for debug, 2 for warning, 3 for notice, 4 for info, 5 for error , default = 55

Thanks

Our implementation was inspired by http://lighthouse.itpathsolutions.com:9011/guide/api