After writing a function, you must debug the function to verify the correctness of code. Actually, the function is automatically triggered when a new log enters the corresponding Logstore. This topic describes how to debug a function in the Function Compute console.

Procedure

  1. Log on to the Function Compute console.
  2. In the top navigation bar, select a region.
  3. In the left-side navigation pane, click Service/Function.
  4. Locate the target function in the target service and click the function name.
  5. On the Code tab, click Event.
  6. Write an event in the event format in the code editor. For more information, see Event format. Click OK.
  7. On the Code tab, click Invoke.

Result

On the Code tab, a prompt that indicates successful execution of the function appears.Result