From 5b341055140b30f0dd6a5469ca4a654c7dd305cd Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Tue, 18 Jul 2023 22:25:28 +0200 Subject: [PATCH] Group most verbose dbg output into more intuitive categories. From now on, having all dbg level except of painting and scrolling shows debug output which can be actually followed. --- src/BufferView.cpp | 2 +- src/CoordCache.cpp | 2 +- src/TextMetrics.cpp | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 85f1e61f9f..12afa84116 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -605,7 +605,7 @@ void BufferView::updateScrollbarParameters() Text & t = buffer_.text(); TextMetrics & tm = d->text_metrics_[&t]; - LYXERR(Debug::GUI, " Updating scrollbar: height: " + LYXERR(Debug::SCROLLING, " Updating scrollbar: height: " << t.paragraphs().size() << " curr par: " << d->cursor_.bottom().pit() << " default height " << defaultRowHeight()); diff --git a/src/CoordCache.cpp b/src/CoordCache.cpp index 2a81328185..7e881780eb 100644 --- a/src/CoordCache.cpp +++ b/src/CoordCache.cpp @@ -48,7 +48,7 @@ void CoordCache::dump() const // (therefore it has type 'void *') (see bug #7376). void const * inset = ccd.first; Point const p = ccd.second.pos; - LYXERR0("Inset " << inset << " has point " << p.x_ << "," << p.y_); + LYXERR(Debug::PAINTING, "Inset " << inset << " has point " << p.x_ << "," << p.y_); } } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 6fdcfe5aaf..2e5fd56215 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1426,7 +1426,7 @@ pit_type TextMetrics::getPitNearY(int y) { LASSERT(!text_->paragraphs().empty(), return -1); LASSERT(!par_metrics_.empty(), return -1); - LYXERR(Debug::DEBUG, "y: " << y << " cache size: " << par_metrics_.size()); + LYXERR(Debug::PAINTING, "y: " << y << " cache size: " << par_metrics_.size()); // look for highest numbered paragraph with y coordinate less than given y pit_type pit = -1; @@ -1467,7 +1467,7 @@ pit_type TextMetrics::getPitNearY(int y) } for (; it != et; ++it) { - LYXERR(Debug::DEBUG, "examining: pit: " << it->first + LYXERR(Debug::PAINTING, "examining: pit: " << it->first << " y: " << it->second.position()); ParagraphMetrics const & pm2 = par_metrics_[it->first]; @@ -1478,7 +1478,7 @@ pit_type TextMetrics::getPitNearY(int y) } } - LYXERR(Debug::DEBUG, "found best y: " << yy << " for pit: " << pit); + LYXERR(Debug::PAINTING, "found best y: " << yy << " for pit: " << pit); return pit; } @@ -1592,7 +1592,7 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const ParagraphMetrics const & pm = par_metrics_[pit]; int yy = pm.position() - pm.rows().front().ascent(); - LYXERR(Debug::DEBUG, "x: " << x << " y: " << y << + LYXERR(Debug::PAINTING, "x: " << x << " y: " << y << " pit: " << pit << " yy: " << yy); int r = 0; @@ -1606,13 +1606,13 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const Row const & row = pm.rows()[r]; - LYXERR(Debug::DEBUG, "row " << r << " from pos: " << row.pos()); + LYXERR(Debug::PAINTING, "row " << r << " from pos: " << row.pos()); bool bound = false; int xx = x; pos_type const pos = getPosNearX(row, xx, bound); - LYXERR(Debug::DEBUG, "setting cursor pit: " << pit << " pos: " << pos); + LYXERR(Debug::PAINTING, "setting cursor pit: " << pit << " pos: " << pos); text_->setCursor(cur, pit, pos, true, bound); // remember new position. @@ -1626,18 +1626,18 @@ InsetList::Element * TextMetrics::checkInsetHit(pit_type pit, int x, int y) Paragraph const & par = text_->paragraphs()[pit]; CoordCache::Insets const & insetCache = bv_->coordCache().getInsets(); - LYXERR(Debug::DEBUG, "x: " << x << " y: " << y << " pit: " << pit); + LYXERR(Debug::PAINTING, "x: " << x << " y: " << y << " pit: " << pit); for (InsetList::Element const & e : par.insetList()) { - LYXERR(Debug::DEBUG, "examining inset " << e.inset); + LYXERR(Debug::PAINTING, "examining inset " << e.inset); if (insetCache.covers(e.inset, x, y)) { - LYXERR(Debug::DEBUG, "Hit inset: " << e.inset); + LYXERR(Debug::PAINTING, "Hit inset: " << e.inset); return const_cast(&e); } } - LYXERR(Debug::DEBUG, "No inset hit. "); + LYXERR(Debug::PAINTING, "No inset hit. "); return nullptr; } -- 2.39.5