1 /* 2 * Copyright the original author or authors. 3 * 4 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.mozilla.org/MPL/MPL-1.1.html 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 import org.as2lib.core.BasicInterface; 18 19 /** 20 * {@code LogLevel} is the basic interface for all levels. 21 * 22 * <p>It is used by loggers to write log messages at different levels and to 23 * define at which levels messages shall be written. 24 * 25 * <p>The default levels offered by the As2lib Logging API in a descending order 26 * are {@code ALL}, {@code DEBUG}, {@code INFO}, {@code WARNING}, {@code ERROR}, 27 * {@code FATAL} and {@code NONE}. All these levels are defined as constants in 28 * the {@link AbstractLogLevel} class. Use this class to reference them. 29 * 30 * <p>It is also possible to create your own log levels. You just must 31 * implement this interface or just instantiate one using the 32 * {@link DynamicLogLevel} class. 33 * 34 * @author Simon Wacker 35 * @author Martin Heidegger 36 */ 37 interface org.as2lib.env.log.LogLevel extends BasicInterface { 38 39 /** 40 * Determines whether this level is greater or equal than the passed-in 41 * {@code level}. 42 * 43 * <p>This is normally done using the number representation of this level and 44 * comparing it using the greater or equal operator with the number representation 45 * of the passed-in {@code level}. 46 * 47 * @param level the level to compare this level with 48 * @return {@code true} if this level is greater or equal than the passed-in 49 * {@code level} else {@code false} 50 */ 51 public function isGreaterOrEqual(level:LogLevel):Boolean; 52 53 /** 54 * Returns the number representation of this level. 55 * 56 * <p>Is used to compare levels with each other. 57 * 58 * @return the number representation of this level 59 */ 60 public function toNumber(Void):Number; 61 62 }