Skip to main content
Deno 2 is finally here 🎉️
Learn more

Deno Debug Build Status

Debug utility for deno.

Usage

import debug from "https://deno.land/x/debuglog/debug.ts";

// create debugger
const service = debug("service");

const serviceName = "app";

// log
service("booting %s", serviceName);

Then run your app.

> DEBUG=* deno run --allow-env app.ts

Todo

  • extending debuggers
  • custom log functions
  • custom formatters
  • log override in all namespaces
  • inspect opts
  • detecting color support
  • non-tty env
  • add debug to registry

Notes

  • Currently debug assumes it is TTY and shows colors by default.
  • Deno’s inspect differs from node’s util.inspect so the output may not be the same.
  • We’re using a custom format function ported from util. Might be cool to extract it when util is ported entirely.
  • We should cover more functionality with tests.