React Native and Expo logger for application
npm install --save nightingale-app-react-native
import { appLogger } from "nightingale-app-react-native";
appLogger.info("hello");
const myServiceLogger = appLogger.child("services:myService");
myServiceLogger.debug("started");
See the Logger API, with all the methods you call to log things.
If you're writing a library, use only nightingale-logger
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)],
},
],
);
- for browser (expo web or react-native-web), see nightingale-browser-console
- for android/ios, expo-sentry can send sourcemaps when publishing for production.