Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix truncating last character in the StderrLogger (#12620)
Summary: This PR fixes a bug in the StderrLogger that truncated the last character in the logline. The problem was that we provided an incorrect max size parameter into the vsnprintf function. The size didn't take into account the null byte that the function automatically adds. Before fix ``` ** File Read Latency Histogram By Level [default] ** 2024/05/04-18:50:24.209304 4788 [/db_impl/db_impl.cc:498] Shutdown: canceling all background wor 2024/05/04-18:50:24.209598 4788 [/db_impl/db_impl.cc:692] Shutdown complet ``` After fix ``` ** File Read Latency Histogram By Level [default] ** 2024/05/04-18:51:19.814584 4d4d [/db_impl/db_impl.cc:498] Shutdown: canceling all background work 2024/05/04-18:51:19.815528 4d4d [/db_impl/db_impl.cc:692] Shutdown complete ``` Pull Request resolved: #12620 Test Plan: tested on examples/simple_example.cc with StderrLogger Fixes: #12576 Reviewed By: jaykorean Differential Revision: D56972332 Pulled By: ajkr fbshipit-source-id: 70405e8231ae6e90d24fe0b351bc8e749176bd15
- Loading branch information