Logging cmd in multiple diary
Hi,
i’m facing an issue in logging using the matlab ‘diary’ functionality. In the below pseudo-code i have 2 tools and both use diary to log the command window output and one is calling other. The diary off for 2nd tool is terminating the diary for the 1st tool as well due to which the remaining cmd display is not getting logged anywhere.
Here is how the logs are:
Is there a way to use ‘diary’ or some other functionality that would help is logging the command window output for the beow example ?
logger1();
function logger1()
logName = fullfile(pwd, ‘log1.txt’);
diary(logName);
fprintf(‘Initialzing logger 1n’);
fprintf(‘Display Message 1n’);
logger2;
fprintf(‘Display Message 2n’);
fprintf(‘End Logn’);
diary off
end
function logger2()
logName = fullfile(pwd, ‘log2.txt’);
diary(logName);
fprintf(‘Initialzing logger 2n’);
fprintf(‘Display Message 1n’);
fprintf(‘End Logn’);
diary off
endHi,
i’m facing an issue in logging using the matlab ‘diary’ functionality. In the below pseudo-code i have 2 tools and both use diary to log the command window output and one is calling other. The diary off for 2nd tool is terminating the diary for the 1st tool as well due to which the remaining cmd display is not getting logged anywhere.
Here is how the logs are:
Is there a way to use ‘diary’ or some other functionality that would help is logging the command window output for the beow example ?
logger1();
function logger1()
logName = fullfile(pwd, ‘log1.txt’);
diary(logName);
fprintf(‘Initialzing logger 1n’);
fprintf(‘Display Message 1n’);
logger2;
fprintf(‘Display Message 2n’);
fprintf(‘End Logn’);
diary off
end
function logger2()
logName = fullfile(pwd, ‘log2.txt’);
diary(logName);
fprintf(‘Initialzing logger 2n’);
fprintf(‘Display Message 1n’);
fprintf(‘End Logn’);
diary off
end Hi,
i’m facing an issue in logging using the matlab ‘diary’ functionality. In the below pseudo-code i have 2 tools and both use diary to log the command window output and one is calling other. The diary off for 2nd tool is terminating the diary for the 1st tool as well due to which the remaining cmd display is not getting logged anywhere.
Here is how the logs are:
Is there a way to use ‘diary’ or some other functionality that would help is logging the command window output for the beow example ?
logger1();
function logger1()
logName = fullfile(pwd, ‘log1.txt’);
diary(logName);
fprintf(‘Initialzing logger 1n’);
fprintf(‘Display Message 1n’);
logger2;
fprintf(‘Display Message 2n’);
fprintf(‘End Logn’);
diary off
end
function logger2()
logName = fullfile(pwd, ‘log2.txt’);
diary(logName);
fprintf(‘Initialzing logger 2n’);
fprintf(‘Display Message 1n’);
fprintf(‘End Logn’);
diary off
end diary, logging MATLAB Answers — New Questions