1.2.2 • Published 5 years ago

@towbe/react-native-log v1.2.2

Weekly downloads
17
License
UNLICENSED
Repository
-
Last release
5 years ago

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
1.2.2

5 years ago

1.2.1

7 years ago

0.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago