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.env.log.Logger; 18 import org.as2lib.env.log.LogLevel; 19 20 /** 21 * {@code HierarchicalLogger} is implemented to enable to logger to take part in a 22 * hierarchy. 23 * 24 * <p>This functionality is needed by the {@link LoggerHierarchy}, a repository that 25 * stores loggers hierarchical. 26 * 27 * @author Simon Wacker 28 */ 29 interface org.as2lib.env.log.HierarchicalLogger extends Logger { 30 31 /** 32 * Returns the parent of this logger. 33 * 34 * <p>This logger normally uses the parent to get the log level, if no one has been 35 * set to this logger manually and to get the handlers of its parents to write the 36 * log messages. 37 * 38 * @return the parent of this logger 39 */ 40 public function getParent(Void):HierarchicalLogger; 41 42 /** 43 * Returns the name of this logger. 44 * 45 * <p>The name is fully qualified and the different parts must be separated by 46 * periods or other characters depending on the usage. The name could for example 47 * be {@code "org.as2lib.core.BasicClass"}. 48 * 49 * @return the name of this logger 50 */ 51 public function getName(Void):String; 52 53 /** 54 * Returns the level of this or the one of the parent logger. 55 * 56 * @return the level of this or the one of the parent logger. 57 */ 58 public function getLevel(Void):LogLevel; 59 60 /** 61 * Returns all handlers this logger broadcasts to when logging a message. 62 * 63 * <p>These handlers are the once directly added to this logger and the once of the 64 * parents. 65 * 66 * @return all added log handlers and the ones of the parents 67 */ 68 public function getAllHandlers(Void):Array; 69 70 }