Socket
Socket
Sign inDemoInstall

rn-logs

Package Overview
Dependencies
516
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rn-logs

React Native Logs


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

React Native Logs

See your logs from React Native on Flipper.

Usage

First you need to install the react-native library with yarn rn-logs or npm i rn-logs, after that you just need to configure the logger before using it:

import { configureLogger } from "rn-logs";

configureLogger({
  isEnabled: __DEV__
});

After configuring the logger, you can use it by creating a new instance of Logger anywhere in your app:

import { Logger } from "rn-logs";
import { interval } from  "rxjs";

const pair = new Logger("pair");
const odd = new Logger("odd");

interval(1_000).subscribe(number => {
    number % 2 === 0
      ? pair.info('Number is pair', { number })
      : odd.warn('Number is odd', { number });
});

And you will be able to see the logs appearing once you have Flipper open (Go to Releases to download the plugin):

Example

FAQs

Last updated on 11 Apr 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc