@towbe/react-native-log
A logging library to be used with react-native apps
Last updated 10 months ago by alial .
UNLICENSED · Repository · Original npm · Tarball · package.json
$ cnpm install @towbe/react-native-log 
SYNC missed versions from official npm registry.

React Native Log

Lightweight logging library for react-native

Installation

$ npm install @towbe/react-native-log

--- or ---

$ yarn add @towbe/react-native-log

Example

By default, a Log’s stream is stdout, and its log level defaults is DEBUG.

Instead of DEBUG, let’s create a log with the info level:

var Log = require('@towbe/react-native-log');

Log.debug('preparing email');
Log.info('sending email');
Log.error('failed to send email');

Change the minimum level at which to log the events:

var Log = require('@towbe/react-native-log');
Log.level = Log.ERROR

You can use %s to pass arguments (much like console.log()):

log.error('oh no, failed to send mail to %s.', user.email);

Log Levels

Mirror that of syslog:

  • ERROR condition error
  • WARNING condition warning
  • NOTICE condition normal, but significant
  • INFO a purely informational message
  • DEBUG debugging information

Current Tags

  • 1.2.2                                ...           latest (10 months ago)

8 Versions

  • 1.2.2                                ...           10 months ago
  • 1.2.1                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)

Copyright 2014 - 2016 © taobao.org |