Second part of onap rename
[appc.git] / appc-adapters / appc-netconf-adapter / appc-netconf-adapter-bundle / src / main / java / org / onap / appc / adapter / netconf / jsch / JSchLogger.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.onap.appc.adapter.netconf.jsch;
26
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30 /**
31  * JSch logger implementation delegating to logback.
32  */
33 public class JSchLogger implements com.jcraft.jsch.Logger {
34
35     private static final Logger LOG = LoggerFactory.getLogger(JSchLogger.class);
36
37     @Override
38     public boolean isEnabled(int level) {
39         return true;
40     }
41
42     @Override
43     public void log(int level, String message) {
44         switch(level) {
45             case com.jcraft.jsch.Logger.DEBUG:
46                 LOG.debug(message);
47                 break;
48
49             case com.jcraft.jsch.Logger.INFO:
50                 LOG.info(message);
51                 break;
52
53             case com.jcraft.jsch.Logger.WARN:
54                 LOG.warn(message);
55                 break;
56
57             case com.jcraft.jsch.Logger.ERROR:
58             case com.jcraft.jsch.Logger.FATAL:
59                 LOG.error(message);
60                 break;
61         }
62     }
63 }