-
Notifications
You must be signed in to change notification settings - Fork 8
Description
As mentioned in #134, it would be nice to have a single means of setting the verbosity level of WecOptTool. For example, in general most minor warnings (BEM results needing minor correction, the creation of directories, etc.) will be silenced. If the user somehow increases the verbosity level (e.g., WecOptTool.setVerbosity(1)), the warnings will be displayed. This could also increase the level of plotting.
This could be accomplished via method shown here: https://www.mathworks.com/help/matlab/matlab_prog/suppress-warnings.html#btmrdj8-4, where you can turn a warning with the ID WecOptTool:MyWarning off by calling warning('off','WecOptTool:MyWarning'). We could perhaps create a function WecOptTool.setVerbosity with something like the following:
function setVerbosity(verbLevel)
% setVerbosity(verbLevel)
%
% ...
if nargin < 1
verbLevel = 0;
end
switch verbLevel
case 0
wset = 'off';
case 1
wset = 'on';
end
% every time you add a warning to a function within WecOptTool, add it to this list
warnIdList = {'WecOptTool:MyWarning', 'WecOptTool:AnotherWarning',...};
for ii = 1:length(warnIdList)
warning(wset, warnIdList{ii})
end