PIbd - 21 Bakalskaya E.D. LabWork7 Hard #10

Closed
ekallin wants to merge 12 commits from LabWork7 into LabWork6
4 changed files with 5 additions and 30 deletions
Showing only changes of commit 6e51b8de54 - Show all commits

View File

@ -39,7 +39,7 @@ public class FormLocomotiveCollections {
public FormLocomotiveCollections(Logger logger) {
_logger = logger;
_logger = LogManager.getLogger("logger");
formElectricLocomotive = new FormElectricLocomotive();
formLocomotiveConfig = new FormLocomotiveConfig();
@ -71,7 +71,7 @@ public class FormLocomotiveCollections {
JOptionPane.showMessageDialog(this.getPictureBoxCollections(), "Коллекция удалена", "Удаление", JOptionPane.INFORMATION_MESSAGE);
_storage.DelSet((String) listBoxStorage.getSelectedValue()); //ТУТ СТРИНГ ОБРАТИ ВНИМАНИЕ КАК-НИБУДЬ
ReloadObjects();
_logger.info("Удален набор: " );
_logger.info("Удален набор: " + listBoxStorage.getSelectedValue());
});
ButtonAddLocomotive.addActionListener(e -> {
@ -101,6 +101,7 @@ public class FormLocomotiveCollections {
});
} catch (LocoStorageOverflowException ex) {
JOptionPane.showMessageDialog(null, ex.getMessage());
_logger.warn("Превышено допустимое количество объектов в коллекции");
}
});

View File

@ -1,7 +1,7 @@
package ProjectElectricLocomotive;
import javax.swing.*;
import org.apache.logging.log4j.*;
import org.apache.logging.log4j.Logger;
public class FrameLocomotiveCollection extends JFrame {
public FormLocomotiveCollections _formLocomotiveCollections;

View File

@ -3,18 +3,9 @@ package ProjectElectricLocomotive;
import org.apache.logging.log4j.*;
public class Main {
private static Logger logger = LogManager.getLogger(Main.class);
public static void main(String[] args)
{
System.setProperty("log4j.configurationFile", "C:\\code\\java\\ProjectElectricLocomotive\\loggerFile.xml");
new FrameLocomotiveCollection(LogManager.getLogger("logger"));
//FrameLocomotiveCollection frameLocomotiveCollection = new FrameLocomotiveCollection(LogManager.getLogger("logger"));
// new FormLocomotiveCollections(LogManager.getLogger(FormLocomotiveCollections.class));
logger.info("hello");
new FrameLocomotiveCollection(LogManager.getLogger());
}
}

View File

@ -1,17 +0,0 @@
# Root logger option
log4j.rootLogger=DEBUG, stdout, file
# Redirect log messages to console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# Redirect log messages to a log file, support file rolling.
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=C:\logs.log
log4j.appender.file.MaxFileSize=5MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n