/src/tools/main/liberty_main_log_level.e
http://github.com/tybor/Liberty · Specman e · 78 lines · 54 code · 10 blank · 14 comment · 0 complexity · e774499119d6c81c7a341770ab1d9fe2 MD5 · raw file
- -- This file is part of Liberty Eiffel.
- --
- -- Liberty Eiffel 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, version 3 of the License.
- --
- -- Liberty Eiffel 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 Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
- --
- expanded class LIBERTY_MAIN_LOG_LEVEL
- feature {ANY}
- is_error: BOOLEAN is
- do
- Result := value = log_error
- end
- is_warning: BOOLEAN is
- do
- Result := value = log_warning
- end
- is_info: BOOLEAN is
- do
- Result := value = log_info
- end
- is_trace: BOOLEAN is
- do
- Result := value = log_trace
- end
- feature {LIBERTY_MAIN}
- valid_arg (arg: STRING): BOOLEAN is
- do
- inspect
- arg
- when "error", "warning", "info", "trace" then
- Result := True
- else
- end
- end
- set (arg: STRING): LIBERTY_MAIN_LOG_LEVEL is
- do
- inspect
- arg
- when "error" then
- value := log_error
- when "warning" then
- value := log_warning
- when "info" then
- value := log_info
- when "trace" then
- value := log_trace
- else
- check False end
- end
- Result := Current
- end
- feature {}
- value: INTEGER_8
- log_error: INTEGER_8 is -2
- log_warning: INTEGER_8 is -1
- log_info: INTEGER_8 is 0
- log_trace: INTEGER_8 is 1
- invariant
- value.in_range(log_error, log_trace)
- end -- class LIBERTY_MAIN_LOG_LEVEL