Skip to content

Commit b0fdd3d

Browse files
committed
suppress warnings when verbose==0
Often, events are saved one-by-one during acquisition. This produces lots of warnings because all the events before the one current one are empty in the logFile. One would expect that these warnings can be suppressed by setting cfg.verbose to 0. Simply adding this condition to the saveEventsFile does the job.
1 parent dfa4bc8 commit b0fdd3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/saveEventsFile.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,15 @@ function printHeaderExtraColumns(logFile)
284284

285285
logFile(iEvent).(namesExtraColumns{iExtraColumn}) = data;
286286

287-
if ~ischar(data) && any(isnan(data))
287+
if ~ischar(data) && any(isnan(data)) && cfg.verbose > 0
288288
warning('saveEventsFile:missingData', ...
289289
'Missing some %s data for this event.', namesExtraColumns{iExtraColumn});
290290

291291
if cfg.verbose > 1
292292
disp(logFile(iEvent));
293293
end
294294

295-
elseif ~ischar(data) && all(isnan(data))
295+
elseif ~ischar(data) && all(isnan(data)) && cfg.verbose > 0
296296
warning('Missing %s data for this event.', namesExtraColumns{iExtraColumn});
297297

298298
if cfg.verbose > 1
@@ -402,7 +402,7 @@ function printHeaderExtraColumns(logFile)
402402
end
403403

404404
% now save the event to log file (if not skipping)
405-
if skipEvent
405+
if skipEvent && cfg.verbose > 0
406406

407407
warning(warningMessageID, warningMessage);
408408

0 commit comments

Comments
 (0)