From e4614cf09b90cc9a0e38d370bb090a11f3877b33 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 14:21:53 +0100 Subject: Add logging support to Matlab --- matlab/tools/astra_mex_log.m | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 matlab/tools/astra_mex_log.m (limited to 'matlab/tools') diff --git a/matlab/tools/astra_mex_log.m b/matlab/tools/astra_mex_log.m new file mode 100644 index 0000000..28cfa18 --- /dev/null +++ b/matlab/tools/astra_mex_log.m @@ -0,0 +1,33 @@ +function [varargout] = astra_mex_log(varargin) +%------------------------------------------------------------------------ +% Reference page in Help browser +% astra_mex_log. +%------------------------------------------------------------------------ +%------------------------------------------------------------------------ +% This file is part of the ASTRA Toolbox +% +% Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp +% 2014-2015, CWI, Amsterdam +% License: Open Source under GPLv3 +% Contact: astra@uantwerpen.be +% Website: http://sf.net/projects/astra-toolbox +%------------------------------------------------------------------------ +% $Id$ +if size(varargin,2)==2 && (strcmp(varargin{1},'debug') || strcmp(varargin{1},'info') || strcmp(varargin{1},'warn') || strcmp(varargin{1},'error')) + d = dbstack(1); + if size(d,1)==0 + astra_mex_log_c(varargin{1},'Unknown',0,varargin{2}) + else + astra_mex_log_c(varargin{1},d(1).file,d(1).line,varargin{2}) + end +else + if nargout == 0 + astra_mex_log_c(varargin{:}); + if exist('ans','var') + varargout{1} = ans; + end + else + varargout = cell(1,nargout); + [varargout{:}] = astra_mex_log_c(varargin{:}); + end +end \ No newline at end of file -- cgit v1.2.3