Home > src > setVerbosePrintVerbosity.m

# setVerbosePrintVerbosity

## PURPOSE

- function for setting the verbosity of the SOS software cmd line output

## SYNOPSIS

function setVerbosePrintVerbosity(fieldName,val)

## DESCRIPTION

     - function for setting the verbosity of the SOS software cmd line output

     copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut

        This file is part of SOS

        SOS is free software: you can redistribute it and/or modify
        it for academic and non-commercial purposes
        under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.  For commercial or for-profit
        uses, please contact the authors (sos@cnbc.cmu.edu).

        SOS is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

## CROSS-REFERENCE INFORMATION

This function calls:

- initVerbosePrint - initializes the flags which control the verbosity of output

This function is called by:

## SOURCE CODE

    0001 % - function for setting the verbosity of the SOS software cmd line output
    0002 %
    0003 % copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut
    0004 %
    0005 %    This file is part of SOS
    0006 %
    0007 %    SOS is free software: you can redistribute it and/or modify
    0008 %    it for academic and non-commercial purposes
    0009 %    under the terms of the GNU General Public License as published by
    0010 %    the Free Software Foundation, either version 3 of the License, or
    0011 %    (at your option) any later version.  For commercial or for-profit
    0012 %    uses, please contact the authors (sos@cnbc.cmu.edu).
    0013 %
    0014 %    SOS is distributed in the hope that it will be useful,
    0015 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
    0016 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    0017 %    GNU General Public License for more details.
    0018
    0019 %    You should have received a copy of the GNU General Public License
    0020 %    along with SOS (see COPYING.txt).
    0021 %    If not, see <http://www.gnu.org/licenses/>.
    0022
    0023
    0024 function setVerbosePrintVerbosity(fieldName,val)
    0025     %% sets the verbosity for a particular field to manipulate whether and how it is output
    0026    if (ischar(fieldName) == false)
    0027         error('{fieldName} supplied to setVerbosePrintVerbosity is not a String');
    0028    end
    0029
    0030    if(isinteger(val) == false)
    0031        error('{val} supplied to setVerbosePrintVerbosity is not an integer');
    0032    end
    0033
    0034     global verbosityFlags;
    0035     if(isempty(verbosityFlags))
    0036         initVerbosePrint();
    0037     end
    0038
    0039
    0040     if (isfield(verbosityFlags,fieldName))
    0041         setfield(verbosityFlags,fieldName) = val; %#ok<NASGU,NASGU: Stored in global for later use>
    0042     else
    0043        error('{fieldName} is not a registered verbosityFlag');
    0044     end
    0045
    0046
    0047 end