1function line_debug(varargin)
2% LINE_DEBUG(MSG, VARARGIN)
3% LINE_DEBUG(OPTIONS, MSG, VARARGIN)
5% Print debug message
if verbose level
is DEBUG.
6% If OPTIONS
struct is passed as first argument, checks options.verbose.
7% Otherwise checks GlobalConstants.Verbose.
9% Copyright (c) 2012-2026, Imperial College London
12% Check
if first argument
is an options
struct with verbose field
13if nargin >= 1 && isstruct(varargin{1}) && isfield(varargin{1},
'verbose')
14 options = varargin{1};
16 args = varargin(3:end);
17 isDebug = (options.verbose == VerboseLevel.DEBUG) || ...
18 (GlobalConstants.Verbose == VerboseLevel.DEBUG);
21 args = varargin(2:end);
22 isDebug = (GlobalConstants.Verbose == VerboseLevel.DEBUG);
26 MSG = sprintf(
'[DEBUG] %s', sprintf(MSG, args{:}));
27 line_printf(
'%s\n', MSG);