跳到内容

实时调试

🌐 Live Debugging

在本文档中,你可以了解如何实时调试 Node.js 进程。

🌐 In this document you can learn about how to live debug a Node.js process.

我的应用表现不如预期

🌐 My application doesn’t behave as expected

症状

🌐 Symptoms

用户可能会注意到,对于某些输入,应用没有提供预期的输出,例如,HTTP 服务器返回的 JSON 响应中某些字段为空。在这个过程中可能会出现各种问题,但在这个用例中,我们主要关注的是应用逻辑及其正确性。

🌐 The user may observe that the application doesn’t provide the expected output for certain inputs, for example, an HTTP server returns a JSON response where certain fields are empty. Various things can go wrong in the process but in this use case, we are mainly focused on the application logic and its correctness.

调试

🌐 Debugging

在这个用例中,用户希望了解我们的应用在某个触发事件(如传入的 HTTP 请求)时执行的代码路径。他们可能还希望逐步调试代码,控制执行流程,并检查内存中变量的值。

🌐 In this use case, the user would like to understand the code path that our application executes for a certain trigger like an incoming HTTP request. They may also want to step through the code and control the execution as well as inspect what values variables hold in memory.