View Javadoc
1   /*
2    * Copyright 2012 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
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, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty5.util.internal.logging;
17  
18  import org.slf4j.Logger;
19  
20  /**
21   * <a href="https://www.slf4j.org/">SLF4J</a> logger.
22   */
23  final class Slf4JLogger extends AbstractInternalLogger {
24  
25      private static final long serialVersionUID = 108038972685130825L;
26  
27      private final transient Logger logger;
28  
29      Slf4JLogger(Logger logger) {
30          super(logger.getName());
31          this.logger = logger;
32      }
33  
34      @Override
35      public boolean isTraceEnabled() {
36          return logger.isTraceEnabled();
37      }
38  
39      @Override
40      public void trace(String msg) {
41          logger.trace(msg);
42      }
43  
44      @Override
45      public void trace(String format, Object arg) {
46          logger.trace(format, arg);
47      }
48  
49      @Override
50      public void trace(String format, Object argA, Object argB) {
51          logger.trace(format, argA, argB);
52      }
53  
54      @Override
55      public void trace(String format, Object... argArray) {
56          logger.trace(format, argArray);
57      }
58  
59      @Override
60      public void trace(String msg, Throwable t) {
61          logger.trace(msg, t);
62      }
63  
64      @Override
65      public boolean isDebugEnabled() {
66          return logger.isDebugEnabled();
67      }
68  
69      @Override
70      public void debug(String msg) {
71          logger.debug(msg);
72      }
73  
74      @Override
75      public void debug(String format, Object arg) {
76          logger.debug(format, arg);
77      }
78  
79      @Override
80      public void debug(String format, Object argA, Object argB) {
81          logger.debug(format, argA, argB);
82      }
83  
84      @Override
85      public void debug(String format, Object... argArray) {
86          logger.debug(format, argArray);
87      }
88  
89      @Override
90      public void debug(String msg, Throwable t) {
91          logger.debug(msg, t);
92      }
93  
94      @Override
95      public boolean isInfoEnabled() {
96          return logger.isInfoEnabled();
97      }
98  
99      @Override
100     public void info(String msg) {
101         logger.info(msg);
102     }
103 
104     @Override
105     public void info(String format, Object arg) {
106         logger.info(format, arg);
107     }
108 
109     @Override
110     public void info(String format, Object argA, Object argB) {
111         logger.info(format, argA, argB);
112     }
113 
114     @Override
115     public void info(String format, Object... argArray) {
116         logger.info(format, argArray);
117     }
118 
119     @Override
120     public void info(String msg, Throwable t) {
121         logger.info(msg, t);
122     }
123 
124     @Override
125     public boolean isWarnEnabled() {
126         return logger.isWarnEnabled();
127     }
128 
129     @Override
130     public void warn(String msg) {
131         logger.warn(msg);
132     }
133 
134     @Override
135     public void warn(String format, Object arg) {
136         logger.warn(format, arg);
137     }
138 
139     @Override
140     public void warn(String format, Object... argArray) {
141         logger.warn(format, argArray);
142     }
143 
144     @Override
145     public void warn(String format, Object argA, Object argB) {
146         logger.warn(format, argA, argB);
147     }
148 
149     @Override
150     public void warn(String msg, Throwable t) {
151         logger.warn(msg, t);
152     }
153 
154     @Override
155     public boolean isErrorEnabled() {
156         return logger.isErrorEnabled();
157     }
158 
159     @Override
160     public void error(String msg) {
161         logger.error(msg);
162     }
163 
164     @Override
165     public void error(String format, Object arg) {
166         logger.error(format, arg);
167     }
168 
169     @Override
170     public void error(String format, Object argA, Object argB) {
171         logger.error(format, argA, argB);
172     }
173 
174     @Override
175     public void error(String format, Object... argArray) {
176         logger.error(format, argArray);
177     }
178 
179     @Override
180     public void error(String msg, Throwable t) {
181         logger.error(msg, t);
182     }
183 }