
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
debugger-logger
Advanced tools
Basic logging of all console actions and module calls and http(s) requests.
Debugger Logger is a Node.js utility package for comprehensive logging and request interception. It provides in-depth debugging tools for Node.js applications, capturing HTTP/HTTPS requests, logging events, and managing application state through various utility methods.
To use this package, clone the repository and install dependencies if required:
git clone https://github.com/overlord-303/debugger
cd debugger
npm install
or install via npm:
npm install debugger-logger@stable
info, debug, error, warning, and traceback.filelog: Fires on logging events to a file.consolelog: Fires on logging events to the console.modulecall: Fires on logging events related to module loading or compiling.http/https) to restore the modules if needed, preventing conflicts or circular dependencies.Provides a snapshot of environment details, such as platform, architecture, Node.js version, and process ID, as well as a utility for checking execution time.
To initialize the Debugger instance, import it into your main application file:
const Debugger = require('debugger-logger');
The Debugger is a singleton and is automatically instantiated as one.
Logs are provided in the follow format:
[0000-00-00 00:00:00] level: 'content' +0ms
Use various log methods to track application events:
Debugger.log('Info message');
Debugger.logDebug('Debug message');
Debugger.logError('Error message');
Add or remove event listeners to track specific events:
function log(filePath, content) {
console.log(`Logged to file: ${filePath}, with message: ${content}.`);
}
Debugger.on('filelog', log);
Debugger.off(Debugger.EVENTS.FILELOG, log);
Intercepted requests are logged automatically, capturing details such as:
If you need to revert back to the original HTTP/HTTPS request functionality:
Debugger.restore('http');
Debugger.restore('https');
Debugger.getData();
will return an object with the following structure:
{
env: {
name: string,
version: string,
platform: NodeJS.Platform,
architecture: NodeJS.Architecture,
nodePath: string,
pid: number
},
memoryUsage: {
rss: {
bytes: number,
kilobytes: number,
megabytes: number
},
heapTotal: {
bytes: number,
kilobytes: number,
megabytes: number
},
heapUsed: {
bytes: number,
kilobytes: number,
megabytes: number
},
external: {
bytes: number,
kilobytes: number,
megabytes: number
},
arrayBuffers: {
bytes: number,
kilobytes: number,
megabytes: number
}
},
executionTimePassed: number
}
MainError is the primary error class used in Debugger Logger to encapsulate detailed error information.
Each MainError instance contains:
Utility function to check if an error is a MainError instance, return value changes based on arguments passed to the function.
Debugger.isMainError(error); // Returns a boolean.
Debugger.isMainError(errorOne, errorTwo); // Returns an array of booleans.
error.getData();
will return an object with the following structure:
{
name: string,
message: string,
timestamp: Date,
stack: string,
code?: string, // Error-Code if created via static method `MainError.fromErrorCode()` or provided via `error.addData()`.
...key?: any, // Any key-value pairs added via `error.addData()`.
}
error.getStacktraceArray();
will return an array with the following structure:
[
number: {
function?: string,
file?: string,
line?: number,
column?: number,
raw?: string, // If parsing fails the `raw` key is provided instead of the ones listed above.
}
]
error.toJSON(); // Returns a JSON formatted string useful for logging.
error.toString(); // Returns a formatted string useful for logging.
This project is licensed under the GNU AGPLv3 License.
FAQs
Basic logging of all console actions and module calls and http(s) requests.
We found that debugger-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.