mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 11:39:44 +03:00
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
This commit is contained in:
parent
6b7602d33b
commit
adbb8d62d1
Notes:
sideshowbarker
2024-07-18 23:11:31 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/adbb8d62d13 Pull-request: https://github.com/SerenityOS/serenity/pull/4931 Reviewed-by: https://github.com/emanuele6
@ -199,7 +199,7 @@ RefPtr<Font> Font::load_from_file(const StringView& path, unsigned index)
|
||||
{
|
||||
auto file_or_error = Core::File::open(String(path), Core::IODevice::ReadOnly);
|
||||
if (file_or_error.is_error()) {
|
||||
dbg() << "Could not open file: " << file_or_error.error();
|
||||
dbgln("Could not open file: {}", file_or_error.error());
|
||||
return nullptr;
|
||||
}
|
||||
auto file = file_or_error.value();
|
||||
|
@ -893,7 +893,7 @@ void Terminal::on_input(u8 ch)
|
||||
m_parser_state = Normal;
|
||||
return;
|
||||
} else {
|
||||
dbg() << "Unexpected character in GotEscape '" << (char)ch << "'";
|
||||
dbgln("Unexpected character in GotEscape '{}'", (char)ch);
|
||||
m_parser_state = Normal;
|
||||
}
|
||||
return;
|
||||
@ -919,7 +919,7 @@ void Terminal::on_input(u8 ch)
|
||||
if (ch == '\\')
|
||||
execute_xterm_command();
|
||||
else
|
||||
dbg() << "Unexpected string terminator: " << String::format("%02x", ch);
|
||||
dbgln("Unexpected string terminator: {:#02x}", ch);
|
||||
m_parser_state = Normal;
|
||||
return;
|
||||
case ExpectParameter:
|
||||
@ -1216,7 +1216,7 @@ void Terminal::execute_hashtag(u8 hashtag)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dbg() << "Unknown hashtag: '" << hashtag << "'";
|
||||
dbgln("Unknown hashtag: '{}'", (char)hashtag);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,11 +34,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PARSE_ASSERT(x) \
|
||||
if (!(x)) { \
|
||||
dbg() << "CSS PARSER ASSERTION FAILED: " << #x; \
|
||||
dbg() << "At character# " << index << " in CSS: _" << css << "_"; \
|
||||
ASSERT_NOT_REACHED(); \
|
||||
#define PARSE_ASSERT(x) \
|
||||
if (!(x)) { \
|
||||
dbgln("CSS PARSER ASSERTION FAILED: {}", #x); \
|
||||
dbgln("At character# {} in CSS: _{}_", index, css); \
|
||||
ASSERT_NOT_REACHED(); \
|
||||
}
|
||||
|
||||
#define PARSE_ERROR() \
|
||||
@ -764,7 +764,7 @@ public:
|
||||
|
||||
auto property_id = CSS::property_id_from_string(property_name);
|
||||
if (property_id == CSS::PropertyID::Invalid) {
|
||||
dbg() << "CSSParser: Unrecognized property '" << property_name << "'";
|
||||
dbgln("CSSParser: Unrecognized property '{}'", property_name);
|
||||
}
|
||||
auto value = parse_css_value(m_context, property_value, property_id);
|
||||
if (!value)
|
||||
|
@ -492,7 +492,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
||||
}
|
||||
return;
|
||||
}
|
||||
dbg() << "Unsure what to do with CSS margin value '" << value.to_string() << "'";
|
||||
dbgln("Unsure what to do with CSS margin value '{}'", value.to_string());
|
||||
return;
|
||||
}
|
||||
return;
|
||||
@ -544,7 +544,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
||||
}
|
||||
return;
|
||||
}
|
||||
dbg() << "Unsure what to do with CSS padding value '" << value.to_string() << "'";
|
||||
dbgln("Unsure what to do with CSS padding value '{}'", value.to_string());
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
@ -73,13 +73,13 @@ void XMLHttpRequest::open(const String& method, const String& url)
|
||||
void XMLHttpRequest::send()
|
||||
{
|
||||
URL request_url = m_window->document().complete_url(m_url);
|
||||
dbg() << "XHR send from " << m_window->document().url() << " to " << request_url;
|
||||
dbgln("XHR send from {} to {}", m_window->document().url(), request_url);
|
||||
|
||||
// TODO: Add support for preflight requests to support CORS requests
|
||||
Origin request_url_origin = Origin(request_url.protocol(), request_url.host(), request_url.port());
|
||||
|
||||
if (!m_window->document().origin().is_same(request_url_origin)) {
|
||||
dbg() << "XHR failed to load: Same-Origin Policy violation: " << m_window->document().url() << " may not load " << request_url;
|
||||
dbgln("XHR failed to load: Same-Origin Policy violation: {} may not load {}", m_window->document().url(), request_url);
|
||||
auto weak_this = make_weak_ptr();
|
||||
if (!weak_this)
|
||||
return;
|
||||
@ -102,7 +102,7 @@ void XMLHttpRequest::send()
|
||||
[weak_this = make_weak_ptr()](auto& error) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
dbg() << "XHR failed to load: " << error;
|
||||
dbgln("XHR failed to load: {}", error);
|
||||
const_cast<XMLHttpRequest&>(*weak_this).set_ready_state(ReadyState::Done);
|
||||
const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::error));
|
||||
});
|
||||
|
@ -113,19 +113,19 @@ void CanvasRenderingContext2D::draw_image(const HTMLImageElement& image_element,
|
||||
|
||||
void CanvasRenderingContext2D::scale(float sx, float sy)
|
||||
{
|
||||
dbg() << "CanvasRenderingContext2D::scale(): " << sx << ", " << sy;
|
||||
dbgln("CanvasRenderingContext2D::scale({}, {})", sx, sy);
|
||||
m_transform.scale(sx, sy);
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::translate(float tx, float ty)
|
||||
{
|
||||
dbg() << "CanvasRenderingContext2D::translate(): " << tx << ", " << ty;
|
||||
dbgln("CanvasRenderingContext2D::translate({}, {})", tx, ty);
|
||||
m_transform.translate(tx, ty);
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::rotate(float radians)
|
||||
{
|
||||
dbg() << "CanvasRenderingContext2D::rotate(): " << radians;
|
||||
dbgln("CanvasRenderingContext2D::rotate({})", radians);
|
||||
m_transform.rotate_radians(radians);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user