Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH - add ft_debug, ft_notice, and ft_info to the private directory o…
…f modules also updated ft_version not to give an error when only a single FT module is on the path
- Loading branch information
1 parent
d7aee08
commit c2e049f
Showing
30 changed files
with
1,456 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function varargout = ft_debug(varargin) | ||
|
||
% FT_DEBUG prints a debug message on screen, depending on the verbosity | ||
% settings of the calling high-level FieldTrip function. | ||
% | ||
% Use as | ||
% ft_debug(...) | ||
% with arguments similar to fprintf, or | ||
% ft_debug(msgId, ...) | ||
% with arguments similar to warning. | ||
% | ||
% You can switch of all messages using | ||
% ft_debug off | ||
% or for specific ones using | ||
% ft_debug off msgId | ||
% | ||
% To switch them back on, you would use | ||
% ft_debug on | ||
% or for specific ones using | ||
% ft_debug on msgId | ||
% | ||
% Messages are only printed once per timeout period using | ||
% ft_debug timeout 60 | ||
% ft_debug once | ||
% or for specific ones using | ||
% ft_debug once msgId | ||
% | ||
% You can see the most recent messages and identifier using | ||
% ft_debug last | ||
% | ||
% You can query the current on/off/once state for all messages using | ||
% ft_debug query | ||
% | ||
% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING | ||
|
||
% Copyright (C) 2017, Robert Oostenveld | ||
% | ||
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org | ||
% for the documentation and details. | ||
% | ||
% FieldTrip is free software: you can redistribute it and/or modify | ||
% it 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. | ||
% | ||
% FieldTrip 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. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with FieldTrip. If not, see <http://www.gnu.org/licenses/>. | ||
% | ||
% $Id$ | ||
|
||
if nargout | ||
[varargout{1:nargout}] = ft_notification(varargin{:}); | ||
elseif isequal(varargin, {'last'}) | ||
% return an answer anyway | ||
varargout{1} = ft_notification(varargin{:}); | ||
else | ||
ft_notification(varargin{:}); | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function varargout = ft_info(varargin) | ||
|
||
% FT_INFO prints an info message on screen, depending on the verbosity | ||
% settings of the calling high-level FieldTrip function. | ||
% | ||
% Use as | ||
% ft_info(...) | ||
% with arguments similar to fprintf, or | ||
% ft_info(msgId, ...) | ||
% with arguments similar to warning. | ||
% | ||
% You can switch of all messages using | ||
% ft_info off | ||
% or for specific ones using | ||
% ft_info off msgId | ||
% | ||
% To switch them back on, you would use | ||
% ft_info on | ||
% or for specific ones using | ||
% ft_info on msgId | ||
% | ||
% Messages are only printed once per timeout period using | ||
% ft_info timeout 60 | ||
% ft_info once | ||
% or for specific ones using | ||
% ft_info once msgId | ||
% | ||
% You can see the most recent messages and identifier using | ||
% ft_info last | ||
% | ||
% You can query the current on/off/once state for all messages using | ||
% ft_info query | ||
% | ||
% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING | ||
|
||
% Copyright (C) 2017, Robert Oostenveld | ||
% | ||
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org | ||
% for the documentation and details. | ||
% | ||
% FieldTrip is free software: you can redistribute it and/or modify | ||
% it 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. | ||
% | ||
% FieldTrip 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. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with FieldTrip. If not, see <http://www.gnu.org/licenses/>. | ||
% | ||
% $Id$ | ||
|
||
if nargout | ||
[varargout{1:nargout}] = ft_notification(varargin{:}); | ||
elseif isequal(varargin, {'last'}) | ||
% return an answer anyway | ||
varargout{1} = ft_notification(varargin{:}); | ||
else | ||
ft_notification(varargin{:}); | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function varargout = ft_notice(varargin) | ||
|
||
% FT_NOTICE prints a notice message on screen, depending on the verbosity | ||
% settings of the calling high-level FieldTrip function. | ||
% | ||
% Use as | ||
% ft_notice(...) | ||
% with arguments similar to fprintf, or | ||
% ft_notice(msgId, ...) | ||
% with arguments similar to warning. | ||
% | ||
% You can switch of all messages using | ||
% ft_notice off | ||
% or for specific ones using | ||
% ft_notice off msgId | ||
% | ||
% To switch them back on, you would use | ||
% ft_notice on | ||
% or for specific ones using | ||
% ft_notice on msgId | ||
% | ||
% Messages are only printed once per timeout period using | ||
% ft_notice timeout 60 | ||
% ft_notice once | ||
% or for specific ones using | ||
% ft_notice once msgId | ||
% | ||
% You can see the most recent messages and identifier using | ||
% ft_notice last | ||
% | ||
% You can query the current on/off/once state for all messages using | ||
% ft_notice query | ||
% | ||
% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING | ||
|
||
% Copyright (C) 2017, Robert Oostenveld | ||
% | ||
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org | ||
% for the documentation and details. | ||
% | ||
% FieldTrip is free software: you can redistribute it and/or modify | ||
% it 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. | ||
% | ||
% FieldTrip 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. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with FieldTrip. If not, see <http://www.gnu.org/licenses/>. | ||
% | ||
% $Id$ | ||
|
||
if nargout | ||
[varargout{1:nargout}] = ft_notification(varargin{:}); | ||
elseif isequal(varargin, {'last'}) | ||
% return an answer anyway | ||
varargout{1} = ft_notification(varargin{:}); | ||
else | ||
ft_notification(varargin{:}); | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function varargout = ft_debug(varargin) | ||
|
||
% FT_DEBUG prints a debug message on screen, depending on the verbosity | ||
% settings of the calling high-level FieldTrip function. | ||
% | ||
% Use as | ||
% ft_debug(...) | ||
% with arguments similar to fprintf, or | ||
% ft_debug(msgId, ...) | ||
% with arguments similar to warning. | ||
% | ||
% You can switch of all messages using | ||
% ft_debug off | ||
% or for specific ones using | ||
% ft_debug off msgId | ||
% | ||
% To switch them back on, you would use | ||
% ft_debug on | ||
% or for specific ones using | ||
% ft_debug on msgId | ||
% | ||
% Messages are only printed once per timeout period using | ||
% ft_debug timeout 60 | ||
% ft_debug once | ||
% or for specific ones using | ||
% ft_debug once msgId | ||
% | ||
% You can see the most recent messages and identifier using | ||
% ft_debug last | ||
% | ||
% You can query the current on/off/once state for all messages using | ||
% ft_debug query | ||
% | ||
% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING | ||
|
||
% Copyright (C) 2017, Robert Oostenveld | ||
% | ||
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org | ||
% for the documentation and details. | ||
% | ||
% FieldTrip is free software: you can redistribute it and/or modify | ||
% it 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. | ||
% | ||
% FieldTrip 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. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with FieldTrip. If not, see <http://www.gnu.org/licenses/>. | ||
% | ||
% $Id$ | ||
|
||
if nargout | ||
[varargout{1:nargout}] = ft_notification(varargin{:}); | ||
elseif isequal(varargin, {'last'}) | ||
% return an answer anyway | ||
varargout{1} = ft_notification(varargin{:}); | ||
else | ||
ft_notification(varargin{:}); | ||
end | ||
|
Oops, something went wrong.