@cca-io/rescript-logger

Simple logger library for ReScript apps


Keywords
rescript, log, logger, logging
License
MIT
Install
npm install @cca-io/rescript-logger@2.0.0

Documentation

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));