Skip to content

Consola - Elegant Console Logger

NPM Last Update NPM Downloads NPM Version

Consola is a lightweight and elegant logging library designed to replace console.log with advanced features such as log levels, custom styles, and formatted output. It is ideal for debugging and logging in Node.js applications and browsers.


Install consola via npm or yarn:

Terminal window
npm install consola
# or
yarn add consola

import consola from "consola";
consola.log("Standard log message");
consola.info("Info message");
consola.success("Success message");
consola.warn("Warning message");
consola.error("Error message");
consola.log("Message in %s", "red", { color: "red" });
consola.info("Message in %s", "bold", { bold: true });

consola.level = 2; // Only show logs of level 2 and below
consola.log("This message will not appear");
consola.warn("This message will appear");
consola.withTag("api").log("Tagged message");
consola.withScope("module", "api").log("Scoped message");

  • Use Tags: To filter and organize logs.
  • Customize Styles: To improve log readability.
  • Manage Levels: To control log verbosity in production.

For more details, check out the Consola official documentation.