Skip to content

Commit 652fa54

Browse files
en0memawesomekling
authored andcommitted
Browser+LibWeb: Silence some debug spams
1 parent e80b887 commit 652fa54

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Userland/Applications/Browser/BrowserWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
560560

561561
new_tab.load(url);
562562

563-
dbgln("Added new tab {:p}, loading {}", &new_tab, url);
563+
dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url);
564564

565565
if (activate)
566566
m_tab_widget->set_active_widget(&new_tab);

Userland/Libraries/LibWeb/Loader/FrameLoader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ bool FrameLoader::load(const LoadRequest& request, Type type)
171171
ResourceLoader::the().load(
172172
favicon_url,
173173
[this, favicon_url](auto data, auto&, auto) {
174-
dbgln("Favicon downloaded, {} bytes from {}", data.size(), favicon_url);
174+
dbgln_if(SPAM_DEBUG, "Favicon downloaded, {} bytes from {}", data.size(), favicon_url);
175175
RefPtr<Gfx::Bitmap> favicon_bitmap;
176176
auto decoder = Gfx::ImageDecoder::try_create(data);
177177
if (!decoder) {
@@ -181,7 +181,7 @@ bool FrameLoader::load(const LoadRequest& request, Type type)
181181
if (!favicon_bitmap)
182182
dbgln("Could not decode favicon {}", favicon_url);
183183
else
184-
dbgln("Decoded favicon, {}", favicon_bitmap->size());
184+
dbgln_if(IMAGE_DECODER_DEBUG, "Decoded favicon, {}", favicon_bitmap->size());
185185
}
186186
load_favicon(favicon_bitmap);
187187
},
@@ -197,7 +197,7 @@ bool FrameLoader::load(const LoadRequest& request, Type type)
197197

198198
bool FrameLoader::load(const URL& url, Type type)
199199
{
200-
dbgln("FrameLoader::load: {}", url);
200+
dbgln_if(SPAM_DEBUG, "FrameLoader::load: {}", url);
201201

202202
if (!url.is_valid()) {
203203
load_error_page(url, "Invalid URL");
@@ -275,9 +275,9 @@ void FrameLoader::resource_did_load()
275275
}
276276

277277
if (resource()->has_encoding()) {
278-
dbgln("This content has MIME type '{}', encoding '{}'", resource()->mime_type(), resource()->encoding().value());
278+
dbgln_if(RESOURCE_DEBUG, "This content has MIME type '{}', encoding '{}'", resource()->mime_type(), resource()->encoding().value());
279279
} else {
280-
dbgln("This content has MIME type '{}', encoding unknown", resource()->mime_type());
280+
dbgln_if(RESOURCE_DEBUG, "This content has MIME type '{}', encoding unknown", resource()->mime_type());
281281
}
282282

283283
auto document = DOM::Document::create();

Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
105105
}
106106

107107
if (url.protocol() == "about") {
108-
dbgln("Loading about: URL {}", url);
108+
dbgln_if(SPAM_DEBUG, "Loading about: URL {}", url);
109109
deferred_invoke([success_callback = move(success_callback)](auto&) {
110110
success_callback(String::empty().to_byte_buffer(), {}, {});
111111
});
112112
return;
113113
}
114114

115115
if (url.protocol() == "data") {
116-
dbgln("ResourceLoader loading a data URL with mime-type: '{}', base64={}, payload='{}'",
116+
dbgln_if(SPAM_DEBUG, "ResourceLoader loading a data URL with mime-type: '{}', base64={}, payload='{}'",
117117
url.data_mime_type(),
118118
url.data_payload_is_base64(),
119119
url.data_payload());
@@ -213,7 +213,7 @@ bool ResourceLoader::is_port_blocked(int port)
213213

214214
void ResourceLoader::clear_cache()
215215
{
216-
dbgln("Clearing {} items from ResourceLoader cache", s_resource_cache.size());
216+
dbgln_if(CACHE_DEBUG, "Clearing {} items from ResourceLoader cache", s_resource_cache.size());
217217
s_resource_cache.clear();
218218
}
219219

0 commit comments

Comments
 (0)