Reason Native
  • Docs
  • Help
  • GitHub

›Console

Overview

  • Introduction
  • Native Basics
  • Getting Started

Rely

  • Introduction
  • Quickstart
  • Guides

    • Setup and Teardown
    • Mock Functions

    API Reference

    • Basic API
    • Expect
  • Advanced

Console

  • Introduction
  • Quickstart
  • API

Pastel

  • Introduction
  • Quickstart
  • API
  • Console

Refmterr

  • Introduction
  • Quickstart

File Context Printer

  • Introduction
  • Quickstart
  • API

Console Quickstart

This quickstart builds off Getting Started and assumes you have a native Reason project set up.

Install Console

To install Console in your project with esy, run

esy add @reason-native/console

This will add @reason-native/console into your package.json.

In order to use Pastel, you must add it to your build system. With dune, console.lib must be added to the relevant dune file:

(libraries ... console.lib)

Sample Code

Go ahead and Console.log anything you like! Check the API documentation for all available methods.

Console.log((1, (2, 3)));
Console.log(2.3323);

Console.warn("\nI'm in stderr");
Console.error(Some(5));
Console.warn(() => {/* anonymous function */});

Console.log("\nI can be meta too:");
Console.debug(Console.debug);
{1, {2, 3}}
2.3323

I'm in stderr
{5}
closure(2257708960)

I can be meta too:
closure(2256368436)
← IntroductionAPI →
  • Install Console
  • Sample Code
Reason Native
Projects
RelyConsolePastelRefmterrFile Context Printer
More
GitHubStar
Facebook Open Source
Copyright © 2021 Facebook Inc.