Flyde: modified debug-logger, same message

Discover debug-logger.ts in Flyde core: a debug log with namespaces, based on the debug library and TS-typed for consistent logs.

domingo, 17 de agosto de 2025 • 3 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Summary of the debug-logger.ts file in the Flyde codebase

In this article we review the debug-logger.ts file located in flyde core src common debug-logger.ts and explain its purpose and operation. The main objective of the module is to provide a consistent debug logger with extensible namespaces for the entire Flyde application.

debugLogger function

The debugLogger function creates a base logger with the flyde namespace and returns an extension of that logger for a sub-namespace passed as a parameter. In practical terms, the debug package is imported, a base logger associated with the flyde namespace is instantiated, and the debugLogger function receives a subNs of type string and returns base extended with that sub-namespace. This way, developers can enable selective debug messages per namespace and maintain a clear organization of logs.

Important technical details

The exported DebugLogger type is the Debugger type from the debug package, allowing consistent typing in TypeScript. The function does not add extra formatting logic; it delegates to the debug library the responsibility of formatting, coloring, and filtering messages according to the DEBUG environment variable or the equivalent configuration in browsers.

debug package

debug is a lightweight JavaScript utility inspired by the debugging technique of the Node.js core. It works both in Node.js and web browsers and allows creating debug namespaces that are activated through the DEBUG environment variable or through local storage in client environments. Typical installation: npm install debug. To use it, debuggers are created with the debug namespace and optionally extended with extend to create sub-namespaces and organize messages.

Usage tips

Enable specific names to avoid flooding the debug output, for example DEBUG=flyde* to see all messages related to flyde, or DEBUG=flyde:execute to focus on execution. In production environments, it is recommended to disable debugging to avoid overhead and filtering of sensitive information.

Integration examples

In the Flyde codebase, the debugLogger function is used to create loggers in different modules, for example in the execution module a logger with the execute sub-namespace is created to trace specific steps of the execution flow. Thanks to TypeScript typing, these loggers can be passed as dependencies and used consistently throughout the application.

About Q2BSTUDIO

Q2BSTUDIO is a software development company specialized in custom applications and custom software. We offer comprehensive solutions including artificial intelligence, AI for businesses, AI agents, cybersecurity, AWS and Azure cloud services, business intelligence services, and Power BI consulting. Our team designs scalable, secure, and results-oriented architectures, integrating AI agents and machine learning models when the project requires it.

Featured services

Custom applications and custom software: full stack development adapted to business processes. Artificial intelligence and AI for businesses: building data pipelines, ML models, and AI agents for automation and improved decision-making. Cybersecurity: audits, hardening, and incident response. AWS and Azure cloud services: migration, cost optimization, and deployment of secure infrastructures. Business intelligence and Power BI services: dashboards and reporting to turn data into actionable decisions.

Why choose us

We combine experience in software architectures, security best practices, and artificial intelligence capabilities to deliver personalized and scalable solutions. We implement loggers and observability tools similar to debug to ensure traceability and ease of maintenance in production and development environments.

Contact and resources

If you want to review the original file, check the GitHub repository at https://github.com/flydelabs/flyde/blob/main/core/src/common/debug-logger.ts and the debug package documentation on npm at https://www.npmjs.com/package/debug. For inquiries about custom projects, artificial intelligence, AI agents, cybersecurity, AWS and Azure cloud services, or Power BI, contact Q2BSTUDIO through our corporate channels.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.