4646
4747SPLIT_REGEX = r"[\s/\[\]\(\)\"\/]"
4848
49+ MAX_LINE_LENGTH = 1000
50+
4951
5052@dataclass
5153class LineRead (Message ):
@@ -108,9 +110,6 @@ def run(self) -> None:
108110 )
109111
110112
111- MAX_LINE_LENGTH = 1000
112-
113-
114113class SearchSuggester (Suggester ):
115114 def __init__ (self , search_index : Mapping [str , str ]) -> None :
116115 self .search_index = search_index
@@ -520,6 +519,7 @@ def get_text(
520519 line_index : int ,
521520 abbreviate : bool = False ,
522521 block : bool = False ,
522+ max_line_length = MAX_LINE_LENGTH ,
523523 ) -> tuple [str , Text , datetime | None ]:
524524 log_file , start , end = self .index_to_span (line_index )
525525 cache_key = (log_file , start , end , abbreviate )
@@ -535,8 +535,8 @@ def get_text(
535535 return "" , Text ("" ), None
536536 line = new_line
537537 timestamp , line , text = log_file .parse (line )
538- if abbreviate and len (text ) > MAX_LINE_LENGTH :
539- text = text [:MAX_LINE_LENGTH ] + "…"
538+ if abbreviate and len (text ) > max_line_length :
539+ text = text [:max_line_length ] + "…"
540540 self ._text_cache [cache_key ] = (line , text , timestamp )
541541 return line , text .copy (), timestamp
542542
0 commit comments