View Javadoc

1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework.
3    * 
4    * Copyright (C) 1999-2006, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  
11  package ch.qos.logback.classic.spi;
12  
13  import java.io.Serializable;
14  
15  import ch.qos.logback.classic.LoggerContext;
16  
17  /**
18   * An interface that allows Logger objects and LoggerSer objects to be used the
19   * same way be client of the LoggingEvent object.
20   * <p>
21   * See {@link LoggerContextRemoteView} for the rationale of this class.
22   * 
23   * @author Ceki G&uuml;lc&uuml;
24   * @author S&eacute;bastien Pennec
25   */
26  public class LoggerRemoteView implements Serializable {
27  
28    private static final long serialVersionUID = 5028223666108713696L;
29  
30    final LoggerContextRemoteView loggerContextView;
31    final String name;
32  
33    public LoggerRemoteView(String name, LoggerContext lc) {
34      this.name = name;
35      assert lc.getLoggerContextRemoteView() != null;
36      loggerContextView = lc.getLoggerContextRemoteView();
37    }
38  
39    public LoggerContextRemoteView getLoggerContextView() {
40      return loggerContextView;
41    }
42  
43    public String getName() {
44      return name;
45    }
46  
47  }