Invite-Only Early Access — Think Throo GitHub App is currently invite-only. Request access here.
2025August

debug-logger.ts in Flyde codebase.

In this article, we will review debug-logger.ts in Flyde codebase. We will look at:

  1. debugLogger function

  2. debug package

debugLogger function

You will find the following code at flyde/core/src/common/debug-logger.ts

import debug from "debug";
 
const BASE_NS = `flyde`;
 
const base = debug(BASE_NS);
 
import type { Debugger as _Debugger } from "debug";
 
export type DebugLogger = _Debugger;
 
export const debugLogger = (subNs: string): DebugLogger => {
  return base.extend(subNs);
};

debug is imported and is assigned to base . In the debugLogger function, base is extended with the parameter passed.

debug package

A tiny JavaScript debugging utility modelled after Node.js core’s debugging technique. Works in Node.js and web browsers.

Installation

 npm install debug

Usage

Check out the debug usage in the documentation

About me:

Hey, my name is Ramu Narasinga. Email: ramu.narasinga@gmail.com

Tired of AI-generated code that works but nobody understands? 

I spent 3+ years studying OSS codebases and wrote 350+ articles on what makes them production-grade. I built an open source tool that reviews your PR against your existing codebase patterns.

Your codebase. Your patterns. Enforced. 

Get started for free —thinkthroo.com

References:

  1. https://github.com/flydelabs/flyde/blob/main/core/src/common/debug-logger.ts#L11

  2. https://www.npmjs.com/package/debug

  3. https://github.com/flydelabs/flyde/blob/main/core/src/execute/index.ts#L103