Socket
Book a DemoInstallSign in
Socket

rn-device-logger

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-device-logger

React Native logger for real devices without the needs to enable Debug JS Remotely & JS Dev Mode to maximize app performance.

1.0.11
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

rn-device-logger

Description

React Native logger for real devices without the needs to enable 'Debug JS Remotely' & 'JS Dev Mode' to maximize app performance.

Getting started

$ npm install rn-device-logger --save

$ npm install -g npm-run

Usage

Start logger server:

$ cd [YOUR_PROJECT] (Ex: $ cd /User/ducth/mighty-rn)

$ npm-run logger

// index.js or app.js or wherever you want

import RNDeviceLogger from "rn-device-logger";

/**
 * Host address or IP address of dev machine that project is running on.
 * Usually same address of your debug host server that you config on real device
 */
const DEBUG_URL = "http://192.168.2.69";

RNDeviceLogger.logDebug(DEBUG_URL, obj); // Log debug (blue color tag)

RNDeviceLogger.logError(DEBUG_URL, obj); // Log error (red color tag)

// Example usage: define function in window to use anywhere in project without import. I'm lazy at writing import statement everytime :))
window.log = obj => {
  console.log(obj);
  RNDeviceLogger.logDebug(DEBUG_URL, obj);
};

Open web browser and type: [HOST_ADDRESS]:8181 (React Native run on port 8081 so I pick 8181 ).

Ex: http://192.168.2.69:8181 (or localhost:8181 if you open browser in same machine)

Your logs will be there, JSON will be pretty formatted.

Keywords

react-native

FAQs

Package last updated on 09 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.