LogTextCondition class final
Entries where one of the texts (searchableTexts) contains the substring text (a non-empty string), case-insensitively.
Case is folded by the rules of String.toLowerCase, beyond ASCII too: SQLite's LIKE and lower()
fold only Latin letters and would give a different result for Cyrillic. So a SQL store does not decide
this condition in SQL: it narrows the candidates (an FTS5 trigram index over searchedTexts, or
prefilterTokens when it has none) and decides with matches over the decoded entries
(collectLogPage, which first drops candidates by mayMatchJson without decoding them).
- Inheritance
-
- Object
- LogCondition
- LogTextCondition
Constructors
- LogTextCondition(String text)
- Not const: needle and prefilterTokens are computed here once per condition, not in matches for every scanned entry.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- needle → String
-
text in lowercase: the substring searched for in searchableTexts.
final
-
prefilterTokens
→ List<
String> -
Fragments of needle that every entry matching this condition contains in the ASCII-lowercased JSON
text of the entry (
logEntryJson): a prefilter for a SQL store that keeps entries as JSON and can fold only ASCII,instr(lower(entry), ?) > 0per fragment. The prefilter only drops rows that cannot match; the store still decides with matches.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
final
Methods
-
matches(
LogEntry entry) → bool -
Whether the entry matches the condition: the reference for stores with their own query language
(their result must agree with it).
override
-
mayMatchJson(
String entryJson) → bool -
Whether an entry whose
logEntryJsonTextisentryJsoncan satisfy this condition: the needle is searched in the lowercased JSON text, without decoding the entry, which costs several times more. Only drops rows that cannot match: the message and the error text appear verbatim in the JSON, except for the characters JSON escapes and the:Dart puts between error type and message; a needle containing any of those is not checked here (true), matches decides after decoding. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
searchableTexts(
LogEntry entry) → List< String> - searchedTexts lowercased: what matches searches.
-
searchedTexts(
LogEntry entry) → List< String> - The entry texts searched for the substring, as written: the message and, if present, the error (LogError.toString). The single definition of where text search looks; a store that indexes text (FTS5) indexes these.