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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wutiange/log-listener-plugin

v2.0.3

Published

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

Readme

Here's the English translation while maintaining the same format and keeping "Log Record" unchanged:

log-listener-plugin

Dependencies npm npm downloads License

中文 | English

To properly use the Log Record client for log collection and troubleshooting, you need to install this plugin in your project.

1. Installation

Install using npm

npm install @wutiange/log-listener-plugin

Install using yarn

yarn add @wutiange/log-listener-plugin

Since the logging system uses HTTP, the project needs to be configured to support HTTP for proper operation.

2. Usage

Call the following code where you need to start recording logs.

2.1 Usage Based on Auto-Discovery

First install react-native-zeroconf, which is used to discover available logging systems in the local network.

yarn add react-native-zeroconf
# or
npm install react-native-zeroconf

For detailed installation steps, please visit: react-native-zeroconf. Don't ignore this line as there are necessary steps to follow. I've also copied these steps below to prevent oversight.

For Android please ensure your manifest is requesting all necessary permissions.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />

IOS 14 requires you to specify the services you want to scan for and a description for what you're using them.

In your info.plist add the following strings:

<key>NSBonjourServices</key>
	<array>
		<string>_http._tcp</string>
	</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Access nearby Log Records to view logs</string>

Then find a suitable place in your project, typically in App.js, to make the call.

import logger from '@wutiange/log-listener-plugin';
// Start log recording
logger.config({isAuto: true});

2.2 Usage Based on Manual Configuration

import logger from '@wutiange/log-listener-plugin';
// Fill in the log server address. If you use auto-discovery, this step can be skipped
logger.config({isAuto: true, testUrl: 'http://127.0.0.1'});

2.3 Setting Basic Data

Set basic data, typically obtained from react-native-device-info. If you don't have specific requirements, you can skip this call as the basic data will be automatically retrieved from react-native-device-info if installed. This basic data is used for filtering and is not mandatory.

logger.config({
  baseData: {
    Brand: DeviceInfo.getBrand(),
    Model: DeviceInfo.getModel(),
    AppVersion: DeviceInfo.getVersion(),
    Carrier: DeviceInfo.getCarrierSync(),
    Manufacturer: DeviceInfo.getManufacturerSync(),
    SystemName: DeviceInfo.getSystemName(),
  }
});

2.4 Individual Recording and Stopping All Records

Try to avoid using the following APIs as they are unnecessary. This data will only be saved to the logging system you have open, so collect whatever is available to facilitate troubleshooting.

// Only capture logs
logger.startRecordLog();
// Only capture network logs
logger.startRecordNetwork();

// Stop log recording, will stop both logs and network
logger.unAuto();

2.5 Other Usage Instructions

If you want to remember the previously saved IP address even after killing the app, consider installing:

yarn add @react-native-async-storage/async-storage

If you have other storage installed locally, you can set it manually:

logger.config({
  storage: // Your storage or custom implementation, as long as it follows the getItem and setItem interface specifications
})

Now all configuration-related items are placed in config to simplify configuration. Each configuration item is optional:

type Options = {
  /**
   * storage is used to store the url of the configured logging system
   * @default @react-native-async-storage/async-storage
   */
  storage?: Storage
  /**
   * Set the upload log timeout in milliseconds
   * @default 3000
   */
  timeout?: number
  /**
   * Logging system url
   */
  testUrl?: string
  /**
   * Whether to automatically start log recording
   * @default false
   */
  isAuto?: boolean
  /**
   * Set basic data for the logging system, this data will be automatically added to each log
   */
  baseData?: Record<string, any>
}

This is the description of each config item.

3. Other Important Notes

  1. If you're using auto-discovery mode, ensure your phone and Log Record client are on the same local network.
  2. When configuring baseUrl, you must enter the address of Log Record. In other words, use the IP address of the computer where you opened the Log Record client. The app integrated with this plugin must be on the same local network as the Log Record client.
  3. If you don't know the logging system's IP, you can find it in the Log Record client under Settings > Connection Instructions (requires version > 1.0.9), as shown in the image below:

ip 地址