Skip to content

Replace io:format error logging with ?TRACE on hot paths #8

Description

@harmon25

Copilot review (PR #4, commit ea95a0a, src/httpd.erl:154).

The request error path logs unconditionally on every parse error:

A:E:S ->
    io:format("Caught error: ~p:~p:~p~n", [A, E, S]),
    {send_close, create_error(?BAD_REQUEST, E)}

This is noisy and expensive on embedded targets and violates the AGENTS.md convention ("gate noise behind ?TRACE, not io:format"). A malicious/garbage client can spam serial output.

There is a similar unconditional io:format in src/httpd_env_api_handler.erl:100.

Fix: route these through the ?TRACE macro so they can be compiled out.

Validated against current code: still present.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions