1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:28:13 +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-15 21:46:23 +01:00 committed by Andreas Kling
parent 27bc48e06c
commit 9229ba0fe9
14 changed files with 130 additions and 80 deletions

View file

@ -25,8 +25,7 @@
*/
#include "Hunks.h"
// #define DEBUG_HUNKS
#include <AK/Debug.h>
namespace Diff {
Vector<Hunk> parse_hunks(const String& diff)
@ -78,21 +77,19 @@ Vector<Hunk> parse_hunks(const String& diff)
hunks.append(hunk);
}
#ifdef DEBUG_HUNKS
for (const auto& hunk : hunks) {
dbgln("Hunk location:");
dbg() << "orig: " << hunk.original_start_line;
dbg() << "target: " << hunk.target_start_line;
dbgln("removed:");
for (const auto& line : hunk.removed_lines) {
dbg() << "- " << line;
}
dbgln("added:");
for (const auto& line : hunk.added_lines) {
dbg() << "+ " << line;
if constexpr (debug_hunks) {
for (const auto& hunk : hunks) {
dbgln("Hunk location:");
dbgln(" orig: {}", hunk.original_start_line);
dbgln(" target: {}", hunk.target_start_line);
dbgln(" removed:");
for (const auto& line : hunk.removed_lines)
dbgln("- {}", line);
dbgln(" added:");
for (const auto& line : hunk.added_lines)
dbgln("+ {}", line);
}
}
#endif
return hunks;
}