1.2.2 • Published 6 years ago
@towbe/react-native-log v1.2.2
React Native Log
Lightweight logging library for react-native
Installation
$ npm install @towbe/react-native-log--- or ---
$ yarn add @towbe/react-native-logExample
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.ERRORYou 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:
ERRORcondition errorWARNINGcondition warningNOTICEcondition normal, but significantINFOa purely informational messageDEBUGdebugging information