source: MML/trunk/applications/orbit/lib/opensyslog.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 522 bytes
Line 
1function varargout=OpenSysLog(varargin)
2%open Log file for application program
3apptype=varargin(1); apptype=char(apptype);
4
5ts = datestr(now,0);
6tmp=[apptype '-' ts ];
7filename=[tmp(1:17) '-' tmp(19:20) tmp(22:23) tmp(25:26)];
8
9[fid,message]=fopen(filename,'w');
10if fid==-1
11  disp(['WARNING: Unable to open system log file:' filename]);
12  disp(message);
13  return
14end
15fprintf(fid,'%s\n',[apptype, ' log file: ' filename]);
16fprintf(fid,'%s\n',['Timestamp: ' datestr(now,0)]);
17disp('System Log file open');
18
19varargout{1}=fid;
Note: See TracBrowser for help on using the repository browser.