Console

The api.console namespace provides logging utilities for debugging and monitoring inside Nexo Maker. These functions work exactly like console.log, console.warn, and console.error, but they are routed through Nexo Maker and automatically prefixed with [Modular].


Methods

api.console.log(...args)

Logs general information.

api.console.log("This is a log message", { key: "value" });
// Output: [Modular] This is a log message { key: "value" }

api.console.warn(...args)

Logs warnings.

api.console.warn("This is a warning");
// Output: [Modular] This is a warning

api.console.error(...args)

Logs errors.

api.console.error("This is an error", new Error("Something went wrong"));
// Output: [Modular] This is an error Error: Something went wrong

Notes

  • Messages logged through api.console are visible in the Nexo Maker browser’s developer tools.

  • Use api.console instead of native console to ensure consistent output formatting and visibility across environments.

Last updated