debug-logger.ts in Flyde codebase.
In this article, we will review debug-logger.ts in Flyde codebase. We will look at:
-
debugLogger function
-
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.