File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212% * fid - file ID returned by ``fopen()``
1313% * log_file_path - path to log file
1414% * write_to_console - writes to both console **and** file, if true
15+ % * manual_flush - true by default on Octave, requiring fflush()
1516%
1617% mp.logger Methods:
1718% * logger - constructor
3637 fid % file ID returned by ``fopen()``
3738 log_file_path % path to log file
3839 write_to_console % writes to both console **and** file, if true
40+ manual_flush = false ; % true by default on Octave, requiring fflush()
3941 end %% properties
4042
4143 methods
7779 % write_to_console (logical) : *(default = 0)* writes to both
7880 % console **and** file, if true
7981
82+ if have_feature(' octave' )
83+ obj.manual_flush = true ;
84+ end
8085 obj .set_file(varargin{: });
8186 end
8287
146151 else %% use our fid, instead of 1 or 2
147152 fprintf(obj .fid, varargin{2 : end });
148153 end
154+ if obj .manual_flush
155+ fflush(obj .fid);
156+ end
149157 if obj .write_to_console
150158 fprintf(varargin{: });
151159 end
You can’t perform that action at this time.
0 commit comments