Использование аннотаций Lombok для логирования
This commit is contained in:
5
pom.xml
5
pom.xml
@@ -119,6 +119,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.16</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TESTING -->
|
||||
<dependency>
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
*/
|
||||
package kinosearch.webapp;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Slf4jLog;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.ContextLoaderListener;
|
||||
@@ -20,8 +19,8 @@ import org.springframework.web.servlet.DispatcherServlet;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
@Slf4j
|
||||
public class WebApp {
|
||||
private final Logger logger = LoggerFactory.getLogger(WebApp.class);
|
||||
private final String host;
|
||||
private final int port;
|
||||
@Autowired
|
||||
@@ -40,7 +39,7 @@ public class WebApp {
|
||||
server.start();
|
||||
server.join();
|
||||
} catch (Exception e) {
|
||||
logger.error("Start server", e);
|
||||
log.error("Start server", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ import kinosearch.core.Kino;
|
||||
import kinosearch.core.KinoPlay;
|
||||
import kinosearch.core.Tools;
|
||||
import kinosearch.core.warez.KinoWarez;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.BeanFactoryUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@@ -32,8 +31,8 @@ import java.net.URL;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@Slf4j
|
||||
public class WebAppController {
|
||||
private final Logger logger = LoggerFactory.getLogger(WebAppController.class);
|
||||
@Autowired
|
||||
private ApplicationContext coreContext;
|
||||
|
||||
@@ -181,7 +180,7 @@ public class WebAppController {
|
||||
con.disconnect();
|
||||
connected = false;
|
||||
_try++;
|
||||
logger.warn("Error connection to '{}': '{}'. Try again...", url.toString(), e.getMessage());
|
||||
log.warn("Error connection to '{}': '{}'. Try again...", url.toString(), e.getMessage());
|
||||
}
|
||||
} while (!connected && _try < 3);
|
||||
|
||||
@@ -233,7 +232,7 @@ public class WebAppController {
|
||||
try {
|
||||
response.sendError(404);
|
||||
} catch (IOException e) {
|
||||
logger.warn("favicon 404", e);
|
||||
log.warn("favicon 404", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user