@@ -219,14 +219,14 @@ function printHeaderExtraColumns(logFile)
219219 warning(' saveEventsFile:missingData' , ...
220220 ' Missing some %s data for this event.' , namesExtraColumns{iExtraColumn });
221221
222- if cfg .verbose
222+ if cfg .verbose > 1
223223 disp(logFile(iEvent ));
224224 end
225225
226226 elseif ~ischar(data ) && all(isnan(data ))
227227 warning(' Missing %s data for this event.' , namesExtraColumns{iExtraColumn });
228228
229- if cfg .verbose
229+ if cfg .verbose > 1
230230 disp(logFile(iEvent ));
231231 end
232232 end
@@ -297,11 +297,11 @@ function printHeaderExtraColumns(logFile)
297297
298298 else
299299
300- printData(logFile(1 ).fileID, onset );
301- printData(logFile(1 ).fileID, duration );
302- printData(logFile(1 ).fileID, trial_type );
300+ printData(logFile(1 ).fileID, onset , cfg );
301+ printData(logFile(1 ).fileID, duration , cfg );
302+ printData(logFile(1 ).fileID, trial_type , cfg );
303303
304- printExtraColumns(logFile , iEvent );
304+ printExtraColumns(logFile , iEvent , cfg );
305305
306306 fprintf(logFile(1 ).fileID, ' \n ' );
307307 fprintf(1 , ' \n ' );
@@ -311,7 +311,7 @@ function printHeaderExtraColumns(logFile)
311311
312312end
313313
314- function printExtraColumns(logFile , iEvent )
314+ function printExtraColumns(logFile , iEvent , cfg )
315315 % loops through the extra columns and print them
316316
317317 namesExtraColumns = returnNamesExtraColumns(logFile );
@@ -320,26 +320,32 @@ function printExtraColumns(logFile, iEvent)
320320
321321 data = logFile(iEvent ).(namesExtraColumns{iExtraColumn });
322322
323- printData(logFile(1 ).fileID, data );
323+ printData(logFile(1 ).fileID, data , cfg );
324324
325325 end
326326
327327end
328328
329- function printData(output , data )
329+ function printData(output , data , cfg )
330330 % write char
331331 % for numeric data we replace any nan by n/a
332332 if ischar(data )
333333 fprintf(output , ' %s\t ' , data );
334- fprintf(1 , ' %s\t ' , data );
334+ if cfg .verbose > 0
335+ fprintf(1 , ' %s\t ' , data );
336+ end
335337 else
336338 for i = 1 : numel(data )
337339 if isnan(data(i ))
338340 fprintf(output , ' %s\t ' , ' n/a' );
339- fprintf(1 , ' %s\t ' , ' n/a' );
341+ if cfg .verbose > 0
342+ fprintf(1 , ' %s\t ' , ' n/a' );
343+ end
340344 else
341345 fprintf(output , ' %f\t ' , data(i ));
342- fprintf(1 , ' %f\t ' , data(i ));
346+ if cfg .verbose > 0
347+ fprintf(1 , ' %f\t ' , data(i ));
348+ end
343349 end
344350 end
345351 end
@@ -384,7 +390,7 @@ function errorSaveEventsFile(identifier)
384390
385391function talkToMe(cfg , logFile )
386392
387- if cfg .verbose
393+ if cfg .verbose > 0
388394
389395 fprintf(1 , ' \n Data were saved in this file:\n\n%s\n\n ' , ...
390396 fullfile( ...
0 commit comments