npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wutiange/log-listener-plugin

v1.3.2

Published

log-record 客户端对应的的插件 Log-record client corresponding plugin

Downloads

43

Readme

log-listener-plugin

Dependencies npm npm downloads License

中文 | English

要想正常使用 log-record 客户端来收集日志,方便排查问题,那么就需要把这个插件安装到项目中。

安装

使用 npm 安装

npm install @wutiange/log-listener-plugin

使用 yarn 安装

yarn add @wutiange/log-listener-plugin

使用

在项目的入口文件中引入,一般为 index.ts 文件。

import logger from '@wutiange/log-listener-plugin';
// 填写日志服务器的地址
logger.setBaseUrl('http://127.0.0.1');
// 设置基础数据,一般数据从 react-native-device-info 中获取,这里你按自己的情况来上报即可,当然你也可以不设置
logger.setBaseData({
  version: displayVersion,
  brand: DeviceInfo.getBrand(),
  model: DeviceInfo.getModel(),
  appVersion: DeviceInfo.getVersion(),
  carrier: DeviceInfo.getCarrierSync(),
  manufacturer: DeviceInfo.getManufacturerSync(),
  systemName: DeviceInfo.getSystemName(),
  deviceUniqueId: DeviceInfo.getUniqueId(),
});

// 启动日志记录
logger.auto();

// 停止日志记录
logger.unAuto();

上面的是最简单的方式,如果你想只抓取日志或网络日志,那么可以采用下面的方式:

// 只抓取日志
logger.startRecordLog();
// 只抓取网络日志
logger.startRecordNetwork();

其他重要说明

在配置 baseUrl 的时候,必须填写的是 log-record 的地址,也就是你在什么电脑打开的 log-record 客户端,那么这里添加的就是对应电脑的 ip 地址。集成这个插件的 app 端要保证跟 log-record 客户端在同一个局域网下。