1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 13:47:42 +00: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:
asynts 2021-01-12 14:11:44 +01:00 committed by Andreas Kling
parent 6b7602d33b
commit adbb8d62d1
6 changed files with 18 additions and 18 deletions

View file

@ -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); auto file_or_error = Core::File::open(String(path), Core::IODevice::ReadOnly);
if (file_or_error.is_error()) { 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; return nullptr;
} }
auto file = file_or_error.value(); auto file = file_or_error.value();

View file

@ -893,7 +893,7 @@ void Terminal::on_input(u8 ch)
m_parser_state = Normal; m_parser_state = Normal;
return; return;
} else { } else {
dbg() << "Unexpected character in GotEscape '" << (char)ch << "'"; dbgln("Unexpected character in GotEscape '{}'", (char)ch);
m_parser_state = Normal; m_parser_state = Normal;
} }
return; return;
@ -919,7 +919,7 @@ void Terminal::on_input(u8 ch)
if (ch == '\\') if (ch == '\\')
execute_xterm_command(); execute_xterm_command();
else else
dbg() << "Unexpected string terminator: " << String::format("%02x", ch); dbgln("Unexpected string terminator: {:#02x}", ch);
m_parser_state = Normal; m_parser_state = Normal;
return; return;
case ExpectParameter: case ExpectParameter:
@ -1216,7 +1216,7 @@ void Terminal::execute_hashtag(u8 hashtag)
} }
break; break;
default: default:
dbg() << "Unknown hashtag: '" << hashtag << "'"; dbgln("Unknown hashtag: '{}'", (char)hashtag);
} }
} }

View file

@ -34,11 +34,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#define PARSE_ASSERT(x) \ #define PARSE_ASSERT(x) \
if (!(x)) { \ if (!(x)) { \
dbg() << "CSS PARSER ASSERTION FAILED: " << #x; \ dbgln("CSS PARSER ASSERTION FAILED: {}", #x); \
dbg() << "At character# " << index << " in CSS: _" << css << "_"; \ dbgln("At character# {} in CSS: _{}_", index, css); \
ASSERT_NOT_REACHED(); \ ASSERT_NOT_REACHED(); \
} }
#define PARSE_ERROR() \ #define PARSE_ERROR() \
@ -764,7 +764,7 @@ public:
auto property_id = CSS::property_id_from_string(property_name); auto property_id = CSS::property_id_from_string(property_name);
if (property_id == CSS::PropertyID::Invalid) { 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); auto value = parse_css_value(m_context, property_value, property_id);
if (!value) if (!value)

View file

@ -492,7 +492,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
} }
return; 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;
} }
return; return;
@ -544,7 +544,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
} }
return; 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;
} }
return; return;

View file

@ -73,13 +73,13 @@ void XMLHttpRequest::open(const String& method, const String& url)
void XMLHttpRequest::send() void XMLHttpRequest::send()
{ {
URL request_url = m_window->document().complete_url(m_url); 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 // TODO: Add support for preflight requests to support CORS requests
Origin request_url_origin = Origin(request_url.protocol(), request_url.host(), request_url.port()); Origin request_url_origin = Origin(request_url.protocol(), request_url.host(), request_url.port());
if (!m_window->document().origin().is_same(request_url_origin)) { 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(); auto weak_this = make_weak_ptr();
if (!weak_this) if (!weak_this)
return; return;
@ -102,7 +102,7 @@ void XMLHttpRequest::send()
[weak_this = make_weak_ptr()](auto& error) { [weak_this = make_weak_ptr()](auto& error) {
if (!weak_this) if (!weak_this)
return; 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).set_ready_state(ReadyState::Done);
const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::error)); const_cast<XMLHttpRequest&>(*weak_this).dispatch_event(DOM::Event::create(HTML::EventNames::error));
}); });

View file

@ -113,19 +113,19 @@ void CanvasRenderingContext2D::draw_image(const HTMLImageElement& image_element,
void CanvasRenderingContext2D::scale(float sx, float sy) void CanvasRenderingContext2D::scale(float sx, float sy)
{ {
dbg() << "CanvasRenderingContext2D::scale(): " << sx << ", " << sy; dbgln("CanvasRenderingContext2D::scale({}, {})", sx, sy);
m_transform.scale(sx, sy); m_transform.scale(sx, sy);
} }
void CanvasRenderingContext2D::translate(float tx, float ty) void CanvasRenderingContext2D::translate(float tx, float ty)
{ {
dbg() << "CanvasRenderingContext2D::translate(): " << tx << ", " << ty; dbgln("CanvasRenderingContext2D::translate({}, {})", tx, ty);
m_transform.translate(tx, ty); m_transform.translate(tx, ty);
} }
void CanvasRenderingContext2D::rotate(float radians) void CanvasRenderingContext2D::rotate(float radians)
{ {
dbg() << "CanvasRenderingContext2D::rotate(): " << radians; dbgln("CanvasRenderingContext2D::rotate({})", radians);
m_transform.rotate_radians(radians); m_transform.rotate_radians(radians);
} }