nightingale-app-react-native
TypeScript icon, indicating that this package has built-in type declarations

15.0.0 • Public • Published

nightingale-app-react-native

React Native and Expo logger for application

Install

npm install --save nightingale-app-react-native

Usage

import { appLogger } from 'nightingale-app-react-native';

appLogger.info('hello');

Create children

const myServiceLogger = appLogger.child('services:myService');
myServiceLogger.debug('started');

The Logger class

See the Logger API, with all the methods you call to log things.

Library

If you're writing a library, use only nightingale-logger

Change default levels

You can override the config using configure:

import {
  configure,
  ReactNativeConsoleHandler,
  Level,
} from 'nightingale-app-react-native';

configure(
  process.env.NODE_ENV === 'production'
    ? []
    : [
        {
          pattern: /^app(:|$)/,
          handlers: [new ReactNativeConsoleHandler(Level.DEBUG)],
          stop: true,
        },
        {
          handlers: [new ReactNativeConsoleHandler(Level.INFO)],
        },
      ],
);

Use source maps to display error stack trace

Package Sidebar

Install

npm i nightingale-app-react-native

Weekly Downloads

2

Version

15.0.0

License

ISC

Unpacked Size

35.2 kB

Total Files

11

Last publish

Collaborators

  • churpeau