@@ -39,34 +39,7 @@ public string PreProcessLine (string logLine, int lineNum, int realLineNum)
3939 {
4040 ArgumentNullException . ThrowIfNull ( logLine , nameof ( logLine ) ) ;
4141
42- if ( realLineNum == 0 )
43- {
44- // store for later field names and field count retrieval
45- _firstLine = new CsvLogLine ( logLine , 0 ) ;
46-
47- if ( _config . MinColumns > 0 )
48- {
49- using CsvReader csv = new ( new StringReader ( logLine ) , _config . ReaderConfiguration ) ;
50- if ( csv . Parser . Count < _config . MinColumns )
51- {
52- // on invalid CSV don't hide the first line from LogExpert, since the file will be displayed in plain mode
53- _isValidCsv = false ;
54- return logLine ;
55- }
56- }
57-
58- _isValidCsv = true ;
59- }
60-
61- if ( _config . HasFieldNames && realLineNum == 0 )
62- {
63- return null ; // hide from LogExpert
64- }
65-
66- return _config . CommentChar != ' ' &&
67- logLine . StartsWith ( "" + _config . CommentChar , StringComparison . OrdinalIgnoreCase )
68- ? null
69- : logLine ;
42+ return PreProcessLine ( logLine . AsMemory ( ) , lineNum , realLineNum ) . ToString ( ) ;
7043 }
7144
7245 public ReadOnlyMemory < char > PreProcessLine ( ReadOnlyMemory < char > logLine , int lineNum , int realLineNum )
@@ -140,18 +113,18 @@ public string[] GetColumnNames ()
140113 return names ;
141114 }
142115
143- public IColumnizedLogLineMemory SplitLine ( ILogLineMemoryColumnizerCallback callback , ILogLineMemory line )
116+ public IColumnizedLogLineMemory SplitLine ( ILogLineMemoryColumnizerCallback callback , ILogLineMemory logLine )
144117 {
145- ArgumentNullException . ThrowIfNull ( line , nameof ( line ) ) ;
118+ ArgumentNullException . ThrowIfNull ( logLine , nameof ( logLine ) ) ;
146119
147120 return _isValidCsv
148- ? SplitCsvLine ( line )
149- : CreateColumnizedLogLine ( line ) ;
121+ ? SplitCsvLine ( logLine )
122+ : CreateColumnizedLogLine ( logLine ) ;
150123 }
151124
152- public IColumnizedLogLine SplitLine ( ILogLineColumnizerCallback callback , ILogLine line )
125+ public IColumnizedLogLine SplitLine ( ILogLineColumnizerCallback callback , ILogLine logLine )
153126 {
154- return SplitLine ( callback as ILogLineMemoryColumnizerCallback , line as ILogLineMemory ) ;
127+ return SplitLine ( callback as ILogLineMemoryColumnizerCallback , logLine as ILogLineMemory ) ;
155128 }
156129
157130 private static ColumnizedLogLine CreateColumnizedLogLine ( ILogLineMemory line )
@@ -180,12 +153,12 @@ public int GetTimeOffset ()
180153 throw new NotImplementedException ( ) ;
181154 }
182155
183- public DateTime GetTimestamp ( ILogLineColumnizerCallback callback , ILogLine line )
156+ public DateTime GetTimestamp ( ILogLineColumnizerCallback callback , ILogLine logLine )
184157 {
185158 throw new NotImplementedException ( ) ;
186159 }
187160
188- public DateTime GetTimestamp ( ILogLineMemoryColumnizerCallback callback , ILogLineMemory line )
161+ public DateTime GetTimestamp ( ILogLineMemoryColumnizerCallback callback , ILogLineMemory logLine )
189162 {
190163 throw new NotImplementedException ( ) ;
191164 }
0 commit comments