function [ syslog ] = readsyslog( path_to_syslog )

% Read-in syslog
% Last modified Mar 13, 2020
% Ben Raanan

syslogpath = char(path_to_syslog);

% readin syslog to struct
fileID = fopen(syslogpath);

if fileID~=-1
    
    formatSpec = '%s';
    txt = textscan(fileID,formatSpec,'Delimiter', '\n');
    syslog = txt{1,1};
    
    if ~isempty(txt)
        fclose(fileID);
    end
    
else
    syslog=[];
    warning([syslogpath ' : Invalid file identifier - check server connection or path'])
end
