LibHTTP: Place HTTP disk cache log points behind a debug flag

These log points are quite verbose. Before we enable the disk cache by
default, let's place them behind a debug flag.
This commit is contained in:
Timothy Flynn 2025-12-01 15:15:45 -05:00 committed by Andreas Kling
parent adcf5462af
commit aae8574d25
Notes: github-actions[bot] 2025-12-02 11:21:02 +00:00
5 changed files with 26 additions and 18 deletions

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Debug.h>
#include <AK/StringBuilder.h>
#include <LibHTTP/Cache/CacheIndex.h>
#include <LibHTTP/Cache/Utilities.h>
@ -68,7 +69,7 @@ ErrorOr<CacheIndex> CacheIndex::create(Database::Database& database)
if (cache_version != CACHE_VERSION) {
if (cache_version != 0)
dbgln("\033[31;1mDisk cache version mismatch:\033[0m stored version = {}, new version = {}", cache_version, CACHE_VERSION);
dbgln_if(HTTP_DISK_CACHE_DEBUG, "\033[31;1mDisk cache version mismatch:\033[0m stored version = {}, new version = {}", cache_version, CACHE_VERSION);
// FIXME: We should more elegantly handle minor changes, i.e. use ALTER TABLE to add fields to CacheIndex.
auto delete_cache_index_table = TRY(database.prepare_statement("DROP TABLE IF EXISTS CacheIndex;"sv));