Skip to content

Build your personal knowledge base with Trilium Notes

client/log syntax highlight: increase the max highlighted lines cap

Adorian Dorana9b3b3a7d158
diff --git a/packages/codemirror/src/extensions/trilium_log_highlighter.ts b/packages/codemirror/src/extensions/trilium_log_highlighter.ts
index 2b9ff74b21..9d2c67a422 100644
--- a/packages/codemirror/src/extensions/trilium_log_highlighter.ts
+++ b/packages/codemirror/src/extensions/trilium_log_highlighter.ts
@@ -49,8 +49,12 @@ const INFO_LINE = /^\d{2}:\d{2}:\d{2}\.\d{3} JS Info:/;
// `Becca (note cache) load took …ms`, `Content hash computation took …ms` — are not caught.
const SLOW_QUERY = /^\d{2}:\d{2}:\d{2}\.\d{3} (Slow (?:recursive )?query)( took )(\d+ms)(?:: (.+))?/;
-/** Upper bound on how many (trailing) lines are highlighted, to cap the per-rebuild work. */
-export const MAX_HIGHLIGHTED_LINES = 10_000;
+/**
+ * Upper bound on how many (trailing) lines are highlighted, to cap the per-rebuild work. Sized well
+ * above a typical single-day backend log (which can be ~10k lines); only pathologically large logs
+ * lose highlighting on their oldest lines.
+ */
+export const MAX_HIGHLIGHTED_LINES = 30_000;
const timestampMark = Decoration.mark({ class: "cm-log-timestamp" });
const slowMark = Decoration.mark({ class: "cm-log-slow" });