View Javadoc
1   package org.codehaus.plexus.logging;
2   
3   /*
4    * Copyright 2001-2006 Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  /**
20   * @author Jason van Zyl
21   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
22   */
23  public interface LoggerManager {
24      String ROLE = LoggerManager.class.getName();
25  
26      /**
27       * Sets the threshold for all new loggers. It will NOT affect the existing loggers.
28       *
29       * This is usually only set once while the logger manager is configured.
30       *
31       * @param threshold The new threshold.
32       */
33      void setThreshold(int threshold);
34  
35      /**
36       * Returns the current threshold for all new loggers.
37       *
38       * @return Returns the current threshold for all new loggers.
39       */
40      int getThreshold();
41  
42      /**
43       * Sets the threshold for all loggers. It affects all the existing loggers
44       * as well as future loggers.
45       *
46       * @param threshold The new threshold.
47       */
48      void setThresholds(int threshold);
49  
50      // The new stuff
51      void setThreshold(String role, int threshold);
52  
53      void setThreshold(String role, String roleHint, int threshold);
54  
55      int getThreshold(String role);
56  
57      int getThreshold(String role, String roleHint);
58  
59      Logger getLoggerForComponent(String role);
60  
61      Logger getLoggerForComponent(String role, String roleHint);
62  
63      void returnComponentLogger(String role);
64  
65      void returnComponentLogger(String role, String hint);
66  
67      int getActiveLoggerCount();
68  }