mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Everywhere: Convert a bunch of dbgprintf() to dbgln()
This commit is contained in:
parent
13e8a2a671
commit
f35a723f61
16 changed files with 32 additions and 32 deletions
|
@ -150,7 +150,7 @@ void Object::custom_event(CustomEvent&)
|
|||
void Object::start_timer(int ms, TimerShouldFireWhenNotVisible fire_when_not_visible)
|
||||
{
|
||||
if (m_timer_id) {
|
||||
dbgprintf("Object{%p} already has a timer!\n", this);
|
||||
dbgln("{} {:p} already has a timer!", class_name(), this);
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
|
|
@ -83,11 +83,11 @@ Clipboard::DataAndType Clipboard::data_and_type() const
|
|||
return {};
|
||||
auto shared_buffer = SharedBuffer::create_from_shbuf_id(response->shbuf_id());
|
||||
if (!shared_buffer) {
|
||||
dbgprintf("GUI::Clipboard::data() failed to attach to the shared buffer\n");
|
||||
dbgln("GUI::Clipboard::data() failed to attach to the shared buffer");
|
||||
return {};
|
||||
}
|
||||
if (response->data_size() > shared_buffer->size()) {
|
||||
dbgprintf("GUI::Clipboard::data() clipping contents size is greater than shared buffer size\n");
|
||||
dbgln("GUI::Clipboard::data() clipping contents size is greater than shared buffer size");
|
||||
return {};
|
||||
}
|
||||
auto data = ByteBuffer::copy(shared_buffer->data<void>(), response->data_size());
|
||||
|
@ -100,7 +100,7 @@ void Clipboard::set_data(ReadonlyBytes data, const String& type, const HashMap<S
|
|||
{
|
||||
auto shared_buffer = SharedBuffer::create_with_size(data.size());
|
||||
if (!shared_buffer) {
|
||||
dbgprintf("GUI::Clipboard::set_data() failed to create a shared buffer\n");
|
||||
dbgln("GUI::Clipboard::set_data() failed to create a shared buffer");
|
||||
return;
|
||||
}
|
||||
if (!data.is_empty())
|
||||
|
|
|
@ -77,7 +77,7 @@ DragOperation::Outcome DragOperation::exec()
|
|||
m_event_loop = make<Core::EventLoop>();
|
||||
auto result = m_event_loop->exec();
|
||||
m_event_loop = nullptr;
|
||||
dbgprintf("%s: event loop returned with result %d\n", class_name(), result);
|
||||
dbgln("{}: event loop returned with result {}", class_name(), result);
|
||||
remove_from_parent();
|
||||
s_current_drag_operation = nullptr;
|
||||
return m_outcome;
|
||||
|
|
|
@ -96,7 +96,7 @@ void InputBox::build()
|
|||
m_ok_button->set_fixed_height(20);
|
||||
m_ok_button->set_text("OK");
|
||||
m_ok_button->on_click = [this](auto) {
|
||||
dbgprintf("GUI::InputBox: OK button clicked\n");
|
||||
dbgln("GUI::InputBox: OK button clicked");
|
||||
m_text_value = m_text_editor->text();
|
||||
done(ExecOK);
|
||||
};
|
||||
|
@ -105,7 +105,7 @@ void InputBox::build()
|
|||
m_cancel_button->set_fixed_height(20);
|
||||
m_cancel_button->set_text("Cancel");
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
dbgprintf("GUI::InputBox: Cancel button clicked\n");
|
||||
dbgln("GUI::InputBox: Cancel button clicked");
|
||||
done(ExecCancel);
|
||||
};
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ void Menu::add_action(NonnullRefPtr<Action> action)
|
|||
{
|
||||
m_items.append(make<MenuItem>(m_menu_id, move(action)));
|
||||
#ifdef GMENU_DEBUG
|
||||
dbgprintf("GUI::Menu::add_action(): MenuItem Menu ID: %d\n", m_menu_id);
|
||||
dbgln("GUI::Menu::add_action(): MenuItem Menu ID: {}", m_menu_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ int Menu::realize_menu(RefPtr<Action> default_action)
|
|||
m_menu_id = WindowServerConnection::the().send_sync<Messages::WindowServer::CreateMenu>(m_name)->menu_id();
|
||||
|
||||
#ifdef MENU_DEBUG
|
||||
dbgprintf("GUI::Menu::realize_menu(): New menu ID: %d\n", m_menu_id);
|
||||
dbgln("GUI::Menu::realize_menu(): New menu ID: {}", m_menu_id);
|
||||
#endif
|
||||
ASSERT(m_menu_id > 0);
|
||||
for (size_t i = 0; i < m_items.size(); ++i) {
|
||||
|
|
|
@ -534,7 +534,7 @@ void Window::update(const Gfx::IntRect& a_rect)
|
|||
for (auto& pending_rect : m_pending_paint_event_rects) {
|
||||
if (pending_rect.contains(a_rect)) {
|
||||
#ifdef UPDATE_COALESCING_DEBUG
|
||||
dbgprintf("Ignoring %s since it's contained by pending rect %s\n", a_rect.to_string().characters(), pending_rect.to_string().characters());
|
||||
dbgln("Ignoring {} since it's contained by pending rect {}", a_rect, pending_rect);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -129,16 +129,16 @@ RefPtr<BitmapFont> BitmapFont::load_from_memory(const u8* data)
|
|||
{
|
||||
auto& header = *reinterpret_cast<const FontFileHeader*>(data);
|
||||
if (memcmp(header.magic, "!Fnt", 4)) {
|
||||
dbgprintf("header.magic != '!Fnt', instead it's '%c%c%c%c'\n", header.magic[0], header.magic[1], header.magic[2], header.magic[3]);
|
||||
dbgln("header.magic != '!Fnt', instead it's '{:c}{:c}{:c}{:c}'", header.magic[0], header.magic[1], header.magic[2], header.magic[3]);
|
||||
return nullptr;
|
||||
}
|
||||
if (header.name[sizeof(header.name) - 1] != '\0') {
|
||||
dbgprintf("Font name not fully null-terminated\n");
|
||||
dbgln("Font name not fully null-terminated");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (header.family[sizeof(header.family) - 1] != '\0') {
|
||||
dbgprintf("Font family not fully null-terminated\n");
|
||||
dbgln("Font family not fully null-terminated");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -888,7 +888,7 @@ static bool process_IHDR(ReadonlyBytes data, PNGLoadingContext& context)
|
|||
|
||||
if (context.interlace_method != PngInterlaceMethod::Null && context.interlace_method != PngInterlaceMethod::Adam7) {
|
||||
#ifdef PNG_DEBUG
|
||||
dbgprintf("PNGLoader::process_IHDR: unknown interlace method: %d\n", context.interlace_method);
|
||||
dbgln("PNGLoader::process_IHDR: unknown interlace method: {}", context.interlace_method);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -736,7 +736,7 @@ void Editor::handle_read_event()
|
|||
case InputState::CSIExpectFinal: {
|
||||
m_state = InputState::Free;
|
||||
if (!(code_point >= 0x40 && code_point <= 0x7f)) {
|
||||
dbgprintf("LibLine: Invalid CSI: %02x (%c)\r\n", code_point, code_point);
|
||||
dbgln("LibLine: Invalid CSI: {:02x} ({:c})", code_point, code_point);
|
||||
continue;
|
||||
}
|
||||
csi_final = code_point;
|
||||
|
@ -797,10 +797,10 @@ void Editor::handle_read_event()
|
|||
}
|
||||
// ^[[5~: page up
|
||||
// ^[[6~: page down
|
||||
dbgprintf("LibLine: Unhandled '~': %d\r\n", param1);
|
||||
dbgln("LibLine: Unhandled '~': {}", param1);
|
||||
continue;
|
||||
default:
|
||||
dbgprintf("LibLine: Unhandled final: %02x (%c)\r\n", code_point, code_point);
|
||||
dbgln("LibLine: Unhandled final: {:02x} ({:c})", code_point, code_point);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue