Skip to content
Snippets Groups Projects
Select Git revision
  • e5f87633107f181fdeef6323b894ab8ac806cd4d
  • master default protected
  • archive
  • v7.14.3
  • v7.14.2
  • v7.14.1
  • v7.14
  • v7.13
  • v7.12
  • v7.11
  • v7.10
  • v7.9
  • v7.8
  • v7.7
  • v7.6
  • v7.5
  • v7.4
  • v7.3
  • v7.3_MultiCellType
  • v7.2
  • v7.2_MultiCell
  • v7.1
  • v7.1_MultiCell
23 results

LogAction.m

  • Eric Wait's avatar
    Eric Wait authored
    e5f87633
    History
    LogAction.m 1.22 KiB
    function LogAction(action,oldValue,newValue)
    %Log is used to keep track of what changes have been made.  It will
    %append entries into a csv file to be opened in excel
    %action = a string to represent what the action is.
    %oldValue and newValue are used to show what numbers are changed. Please
    %use the action string to denote what the values represent
    
    %--Eric Wait
    
    global Figures CONSTANTS
    time = clock;%[year month day hour minute seconds]
    
    load('LEVerSettings.mat');
    
    [x usr] = system('whoami');
    ind = strfind(usr, '\');
    usr = usr(:,ind+1:end-1);
    
    row = [[num2str(time(1)) '/' num2str(time(2)) '/' num2str(time(3))] ','...
        [num2str(time(4)) ':' num2str(time(5)) ':' num2str(round(time(6)))] ',' usr ',,'...
        action ',' num2str(Figures.time) ','];
    if(~isempty(oldValue))
        row = [row num2str(oldValue) ','];
    else
        row = [row ','];
    end
    if(~isempty(newValue))
        row = [row num2str(newValue) '\n'];
    else
        row = [row '\n'];
    end
    
    if (~exist([settings.matFilePath CONSTANTS.datasetName '_log.csv'],'file'))
        %add headers
        row = ['Date,Time,User,,Action,Frame,Old Value,New Value,\n' row];
    end
    
    file = fopen([settings.matFilePath CONSTANTS.datasetName '_log.csv'],'a');
    
    fprintf(file,row);
    fclose(file);
    
    % TestDataIntegrity(0)
    end