@pyou/copylog
v1.0.6
Published
copylog
Readme
Install
Using npm:
npm install @pyou/copylogUsing yarn:
yarn add @pyou/copylogUsage
Use the setLog method to store log information:
import { setLog } from "@pyou/copylog";
const add = () => {
let a = 1, b = 1, c;
setLog('before add');
c = a + b;
setLog('after add');
return c;
}When you need to copy the log information, you need to create a div block, and then bind a click event to the div node. The callback logic of the event is to execute the showConfirm method. When you click the div 10 times, it will pop up A confirm box, after clicking confirm, the log information will be written to the pasteboard. At this time, you only need to select the paste function to copy the log information to other places.
import { showConfirm } from "@pyou/copylog";
//react jsx
<div onClick={showConfirm} />