Simple logger library for Reason/BuckleScript apps
npm install @cca-io/re-loggerSimple logger library for Reason/BuckleScript apps.
``shellyarn
yarn add @cca-io/re-logger
Then add re-logger to the dependencies in your
bsconfig.json, e.g.:`
{
"name": "my-app",
...
"bs-dependencies": ["reason-react", "@cca-io/re-logger"],
...
}
`Usage
Example:
`reason
module Log = (val ReLogger.make(__MODULE__));Log.info("Starting");
/ ... /
Log.error2("Startup error", error);
`The actual logger implementation is pluggable, so it can be swapped out e.g. for usage with React Native:
`reason
ReLogger.setLoggerImpl((module MyNativeLoggerImpl));
``