Skip to content

Commit

Permalink
added log4j
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswoehlke committed Feb 20, 2020
1 parent 1953234 commit 417f027
Show file tree
Hide file tree
Showing 61 changed files with 149 additions and 145 deletions.
10 changes: 7 additions & 3 deletions allinone/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ test {
ext {
jacksonDatabindVersion = '2.9.8' //2.9.8,2.10.2
lombokVersion = '1.18.12'
log4jVersion = '2.13.0'
log4j2Version = '2.13.0'
log4j12Version = '1.2.17'
}

dependencies {
Expand All @@ -81,8 +82,11 @@ dependencies {
implementation 'org.yaml:snakeyaml:1.17'
implementation 'com.google.guava:guava:28.0-jre'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation 'org.apache.logging.log4j:log4j:'+log4jVersion
implementation 'org.apache.logging.log4j:log4j-core:'+log4jVersion
implementation 'org.apache.logging.log4j:log4j:'+log4j2Version
implementation 'org.apache.logging.log4j:log4j-core:'+log4j2Version
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:'+log4j2Version
implementation 'org.apache.logging.log4j:log4j-api:'+log4j2Version
implementation 'org.apache.logging.log4j:log4j-jcl:'+log4j2Version
testImplementation("junit:junit:4.13")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.6.0")
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.woehlke.computer.kurzweil;

import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilApplicationFrame;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties;
import org.woehlke.computer.kurzweil.commons.Startable;
Expand All @@ -26,7 +26,7 @@
* <p>
* &copy; 2006 - 2008 Thomas Woehlke.
*/
@Log
@Log4j2
public class ComputerKurzweilApplication implements Startable {

private final ComputerKurzweilApplicationFrame frame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.commons.Startable;
import org.woehlke.computer.kurzweil.model.LatticePoint;
import org.woehlke.computer.kurzweil.tabs.evolution.cell.CellCore;
Expand All @@ -15,7 +15,7 @@
import java.util.Date;
import java.util.Random;

@Log
@Log4j2
@Getter
@ToString(exclude={"random","frame"},callSuper=true)
public class ComputerKurzweilApplicationContext implements Startable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.commons.tabs.TabPanel;
import org.woehlke.computer.kurzweil.widgets.layouts.BoxLayoutVertical;
import org.woehlke.computer.kurzweil.commons.Startable;
Expand All @@ -23,7 +23,7 @@
import java.io.Serializable;
import java.util.List;

@Log
@Log4j2
@Getter
@ToString(callSuper=true)
public class ComputerKurzweilApplicationFrame extends JFrame implements Serializable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.commons.GuiComponentTab;
import org.woehlke.computer.kurzweil.commons.Startable;
import org.woehlke.computer.kurzweil.tabs.cca.CyclicCellularAutomatonTab;
Expand All @@ -15,14 +15,13 @@
import org.woehlke.computer.kurzweil.tabs.randomwalk.WienerProcessTab;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;

@Log
@Log4j2
@Getter
@ToString(exclude={"ctx","apps","border"},callSuper=true)
@EqualsAndHashCode(callSuper=true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import lombok.*;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.tabs.TabType;

import javax.validation.Valid;
Expand All @@ -13,7 +13,7 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

@Log
@Log4j2
@ToString
@EqualsAndHashCode
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilApplicationContext;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilApplicationTabbedPane;
import org.woehlke.computer.kurzweil.tabs.TabType;
Expand All @@ -13,7 +13,7 @@
import javax.swing.*;
import javax.swing.border.Border;

@Log
@Log4j2
@Getter
@ToString(callSuper = true, exclude = {"ctx","tabbedPane","border","layout","panelSubtitle"})
@EqualsAndHashCode(callSuper=true, exclude = {"ctx","tabbedPane","border","layout","panelSubtitle"})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.woehlke.computer.kurzweil.model;

import lombok.*;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;

import javax.swing.*;
import java.awt.*;
import java.io.Serializable;

@Log
@Log4j2
@Getter
@ToString
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;

@Log
@Log4j2
@Getter
@ToString
@EqualsAndHashCode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.woehlke.computer.kurzweil.model;

import lombok.*;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;

/**
* A Point is used to define the Position of Cell or as a Vector for defining Dimensions.
Expand All @@ -16,7 +16,7 @@
* Date: 04.02.2006
* Time: 23:47:05
*/
@Log
@Log4j2
@Getter
@Setter
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.commons.GuiComponentTab;

import javax.swing.*;
import javax.swing.border.CompoundBorder;
import java.awt.*;

@Log
@Log4j2
@Getter
@ToString(callSuper = true, exclude = {"buttonVonNeumann","buttonMoore","buttonWoehlke"})
@EqualsAndHashCode(callSuper=true, exclude = {"buttonVonNeumann","buttonMoore","buttonWoehlke"})
Expand Down Expand Up @@ -50,9 +50,7 @@ public CyclicCellularAutomatonButtons(

@Override
public void showMe() {
log.info("showMe");
this.setVisible(true);
repaint();
//log.info("showMe");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.commons.tabs.TabCanvas;
import org.woehlke.computer.kurzweil.commons.tabs.TabModel;
import org.woehlke.computer.kurzweil.model.LatticeNeighbourhoodType;
Expand All @@ -30,7 +30,7 @@
* Date: 05.02.2006
* Time: 00:51:51
*/
@Log
@Log4j2
@Getter
@ToString(callSuper = true, exclude = {"tabCtx","border","preferredSize","layout","colorScheme","lattice"})
@EqualsAndHashCode(callSuper=true, exclude = {"tabCtx","border","preferredSize","layout","colorScheme","lattice"})
Expand Down Expand Up @@ -103,24 +103,24 @@ public void update(Graphics g) {

@Override
public void showMe() {
//log.info("showMe "+this.toString());
log.info("showMe "+this.toString());
}

public void start() {
//log.info("start");
log.info("start");
showMe();
synchronized (running) {
running = Boolean.TRUE;
}
//log.info("started "+this.toString());
log.info("started "+this.toString());
}

public void stop() {
//log.info("stop");
log.info("stop");
synchronized (running) {
running = Boolean.FALSE;
}
//log.info("stopped "+this.toString());
log.info("stopped "+this.toString());
}

public void update(){
Expand Down Expand Up @@ -163,15 +163,15 @@ public void step(){
}

private void initCreateLattice(){
//log.info("initCreateLattice start: "+neighbourhoodType.name());
log.info("initCreateLattice start: "+neighbourhoodType.name());
lattice = new int[versions][worldX][worldY];
source = 0;
target = 1;
//log.info("initCreateLattice finished: "+neighbourhoodType.name());
log.info("initCreateLattice finished: "+neighbourhoodType.name());
}

private void initFillLattice(){
//log.info("initCreateLattice start: "+neighbourhoodType.name());
log.info("initCreateLattice start: "+neighbourhoodType.name());
Random random = this.tabCtx.getCtx().getRandom();
int maxState = this.colorScheme.getMaxState();
int y;
Expand All @@ -181,7 +181,7 @@ private void initFillLattice(){
lattice[source][x][y] = random.nextInt(maxState);
}
}
//log.info("initCreateLattice finished: "+neighbourhoodType.name());
log.info("initCreateLattice finished: "+neighbourhoodType.name());
}

public void resetLattice(){
Expand All @@ -190,20 +190,18 @@ public void resetLattice(){
}

public void startWithNeighbourhoodVonNeumann() {
/*
if( this.neighbourhoodType == null) {
log.info("startWithNeighbourhoodVonNeumann");
} else {
log.info("startWithNeighbourhoodVonNeumann: " + neighbourhoodType.name());
}
*/
this.neighbourhoodType=VON_NEUMANN_NEIGHBORHOOD;
resetLattice();
log.info("startWithNeighbourhoodVonNeumann started: "+neighbourhoodType.name());
}

public void startWithNeighbourhoodMoore() {
//log.info("startWithNeighbourhoodVonNeumann: "+neighbourhoodType.name());
log.info("startWithNeighbourhoodVonNeumann: "+neighbourhoodType.name());
this.neighbourhoodType=MOORE_NEIGHBORHOOD;
resetLattice();
log.info("startWithNeighbourhoodVonNeumann started: "+neighbourhoodType.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilApplicationContext;
import org.woehlke.computer.kurzweil.tabs.TabType;
import org.woehlke.computer.kurzweil.commons.tabs.TabContext;

import static java.lang.Thread.State.NEW;
import static org.woehlke.computer.kurzweil.tabs.TabType.CYCLIC_CELLULAR_AUTOMATON;

@Log
@Log4j2
@Getter
@ToString(callSuper = true, exclude = {"tab"})
@EqualsAndHashCode(exclude = {"tab"})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.woehlke.computer.kurzweil.tabs.cca;

import lombok.Getter;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilApplicationContext;
import org.woehlke.computer.kurzweil.commons.tabs.TabController;

Expand All @@ -15,7 +15,7 @@
* Date: 05.02.2006
* Time: 00:36:20
*/
@Log
@Log4j2
@Getter
public class CyclicCellularAutomatonController extends Thread
implements TabController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.application.ComputerKurzweilApplicationTabbedPane;
import org.woehlke.computer.kurzweil.tabs.TabType;
import org.woehlke.computer.kurzweil.commons.tabs.TabPanel;
Expand All @@ -13,7 +13,7 @@

import java.awt.event.ActionEvent;

@Log
@Log4j2
@Getter
@ToString(callSuper = true, exclude = {"tabCtx"})
@EqualsAndHashCode(callSuper=true, exclude = {"tabCtx"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j2;
import org.woehlke.computer.kurzweil.commons.tabs.TabCanvas;
import org.woehlke.computer.kurzweil.commons.tabs.TabModel;
import org.woehlke.computer.kurzweil.model.LatticeNeighbourhood;
Expand All @@ -28,7 +28,7 @@
* Date: 05.02.2006
* Time: 00:51:51
*/
@Log
@Log4j2
@Getter
@ToString(callSuper = true, exclude = {"tabCtx","border","preferredSize","layout","particles"})
@EqualsAndHashCode(callSuper=true, exclude = {"tabCtx","border","preferredSize","layout","particles"})
Expand Down
Loading

0 comments on commit 417f027

Please sign in to comment.