12345678910111213141516 |
- function []= LogMsg(msg, fileName)
-
- logDir = '_Log/';
- if isdir(logDir) == 0
- mkdir(logDir);
- end
-
- if nargin<2
- fileName = 'log.txt';
- end
-
- fullFileName = sprintf('%s%s',logDir,fileName);
- fileID = fopen(fullFileName,'a');
- fprintf(fileID,'%s\n',msg);
- fprintf('%s\n',msg);
- fclose(fileID);
|