1.0.11 • Published 5 years ago

rn-device-logger v1.0.11

Weekly downloads
18
License
-
Repository
-
Last release
5 years ago

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.

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago