@cca-io/re-logger
v1.2.0
Published
Simple logger library for Reason/BuckleScript apps
Downloads
12
Readme
re-logger
Simple logger library for Reason/BuckleScript apps.
Installation
# yarn
yarn add @cca-io/re-logger
# or npm
npm install @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:
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:
ReLogger.setLoggerImpl((module MyNativeLoggerImpl));