mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.SystemProperties;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.api.GlobalOptions;
|
||||
|
||||
import java.io.*;
|
||||
@@ -83,8 +84,9 @@ public class LogSetup {
|
||||
}
|
||||
|
||||
private static class MyLoggerFactory implements Logger.Factory {
|
||||
@NotNull
|
||||
@Override
|
||||
public Logger getLoggerInstance(String category) {
|
||||
public Logger getLoggerInstance(@NotNull String category) {
|
||||
return new Log4jBasedLogger(org.apache.log4j.Logger.getLogger(category));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,8 +406,9 @@ public class JpsGantProjectBuilder {
|
||||
private static AntMessageHandler ourMessageHandler;
|
||||
private static Logger.Factory ourFileLoggerFactory;
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Logger getLoggerInstance(String category) {
|
||||
public Logger getLoggerInstance(@NotNull String category) {
|
||||
DefaultLogger antLogger = new DefaultLogger(category) {
|
||||
@Override
|
||||
public void error(@NonNls String message, @Nullable Throwable t, @NotNull @NonNls String... details) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PatternLayout;
|
||||
import org.apache.log4j.RollingFileAppender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -42,8 +43,9 @@ public class Log4jFileLoggerFactory implements com.intellij.openapi.diagnostic.L
|
||||
myAppender.setMaxBackupIndex(10);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public com.intellij.openapi.diagnostic.Logger getLoggerInstance(String category) {
|
||||
public com.intellij.openapi.diagnostic.Logger getLoggerInstance(@NotNull String category) {
|
||||
final Logger logger = Logger.getLogger(category);
|
||||
logger.addAppender(myAppender);
|
||||
logger.setLevel(isDebugLevel(category) ? Level.DEBUG : Level.INFO);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.apache.log4j.LogManager;
|
||||
import org.apache.log4j.xml.DOMConfigurator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringReader;
|
||||
@@ -35,8 +36,9 @@ public class LoggerFactory implements Logger.Factory {
|
||||
|
||||
private LoggerFactory() { }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public synchronized Logger getLoggerInstance(String name) {
|
||||
public synchronized Logger getLoggerInstance(@NotNull String name) {
|
||||
try {
|
||||
if (!myInitialized) {
|
||||
init();
|
||||
|
||||
@@ -46,8 +46,9 @@ public class TestLoggerFactory implements Logger.Factory {
|
||||
|
||||
private TestLoggerFactory() { }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public synchronized Logger getLoggerInstance(final String name) {
|
||||
public synchronized Logger getLoggerInstance(@NotNull final String name) {
|
||||
if (!myInitialized) {
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public class Log4jBasedLogger extends Logger {
|
||||
protected final org.apache.log4j.Logger myLogger;
|
||||
|
||||
public Log4jBasedLogger(org.apache.log4j.Logger delegate) {
|
||||
public Log4jBasedLogger(@NotNull org.apache.log4j.Logger delegate) {
|
||||
myLogger = delegate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user