Skip to content

Commit 188558b

Browse files
committed
changed logger to static
1 parent 88ef989 commit 188558b

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

src/main/java/de/doubleslash/keeptime/DefaultExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
public class DefaultExceptionHandler implements UncaughtExceptionHandler {
1414

15-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
15+
private static final Logger LOG = LoggerFactory.getLogger(DefaultExceptionHandler.class);
1616

1717
@Override
1818
public void uncaughtException(final Thread t, final Throwable e) {

src/main/java/de/doubleslash/keeptime/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@SpringBootApplication
4545
public class Main extends Application {
4646

47-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
47+
private static final Logger LOG = LoggerFactory.getLogger(Main.class);
4848

4949
public static final String VERSION = "v0.0.2";
5050

src/main/java/de/doubleslash/keeptime/common/ConfigParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import javafx.scene.paint.Color;
1818

1919
public class ConfigParser {
20-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
20+
private static final Logger LOG = LoggerFactory.getLogger(ConfigParser.class);
2121

2222
private final Controller controller;
2323

src/main/java/de/doubleslash/keeptime/controller/Controller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@Service
2727
public class Controller {
2828

29-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
29+
private static final Logger LOG = LoggerFactory.getLogger(Controller.class);
3030

3131
private final Model model;
3232

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class ReportController {
4848
@FXML
4949
private ScrollPane scrollPane;
5050

51-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
51+
private static final Logger LOG = LoggerFactory.getLogger(ReportController.class);
5252

5353
private DatePicker datePicker; // for calender element
5454

@@ -82,7 +82,8 @@ private void updateReport(final LocalDate newvalue) {
8282
long currentSeconds = 0;
8383
for (final Project project : workedProjectsSet) {
8484
final Label projectName = new Label(project.getName());
85-
projectName.setFont(Font.font("System", FontWeight.BOLD, 15));
85+
final Font labelFont = Font.font("System", FontWeight.BOLD, 15);
86+
projectName.setFont(labelFont);
8687
gridPane.add(projectName, 0, rowIndex);
8788

8889
final List<Work> onlyCurrentProjectWork = currentWorkItems.stream().filter(w -> w.getProject() == project)
@@ -98,7 +99,7 @@ private void updateReport(final LocalDate newvalue) {
9899
}
99100

100101
final Label workedTimeLabel = new Label(DateFormatter.secondsToHHMMSS(todaysWorkSeconds));
101-
workedTimeLabel.setFont(Font.font("System", FontWeight.BOLD, 15));
102+
workedTimeLabel.setFont(labelFont);
102103
gridPane.add(workedTimeLabel, 2, rowIndex);
103104
rowIndex++;
104105

src/main/java/de/doubleslash/keeptime/view/SettingsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class SettingsController {
6262
@FXML
6363
private Label versionLabel;
6464

65-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
65+
private static final Logger LOG = LoggerFactory.getLogger(SettingsController.class);
6666

6767
private Model model;
6868
private Controller controller;

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
@Component
8181
public class ViewController {
82-
private static final String _00_00_00 = "00:00:00";
82+
private static final String TIME_00_00_00 = "00:00:00";
8383
@FXML
8484
private Pane pane;
8585
@FXML
@@ -119,7 +119,7 @@ public class ViewController {
119119
@FXML
120120
private Canvas canvas;
121121

122-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
122+
private static final Logger LOG = LoggerFactory.getLogger(ViewController.class);
123123

124124
private class Delta {
125125
double x;
@@ -167,9 +167,9 @@ public void changeProject(final Project newProject, final long minusSeconds) {
167167
@FXML
168168
private void initialize() throws IOException {
169169

170-
bigTimeLabel.setText(_00_00_00);
171-
allTimeLabel.setText(_00_00_00);
172-
todayAllSeconds.setText(_00_00_00);
170+
bigTimeLabel.setText(TIME_00_00_00);
171+
allTimeLabel.setText(TIME_00_00_00);
172+
todayAllSeconds.setText(TIME_00_00_00);
173173

174174
textArea.setWrapText(true);
175175
textArea.setEditable(false);
@@ -599,17 +599,17 @@ private Node addProjectToProjectList(final Project p) {
599599
gridRow++;
600600
grid.add(new Label("Active project duration: " + model.activeWorkItem.get().getProject().getName()), 0,
601601
gridRow);
602-
final Label currentProjectTimeLabel = new Label(_00_00_00);
602+
final Label currentProjectTimeLabel = new Label(TIME_00_00_00);
603603
grid.add(currentProjectTimeLabel, 1, gridRow);
604604
gridRow++;
605605

606606
grid.add(new Label("New end and start time:"), 0, gridRow);
607-
final Label newEndTimeLabel = new Label(_00_00_00);
607+
final Label newEndTimeLabel = new Label(TIME_00_00_00);
608608
grid.add(newEndTimeLabel, 1, gridRow);
609609
gridRow++;
610610

611611
grid.add(new Label("New project duration: " + p.getName()), 0, gridRow);
612-
final Label newProjectTimeLabel = new Label(_00_00_00);
612+
final Label newProjectTimeLabel = new Label(TIME_00_00_00);
613613
grid.add(newProjectTimeLabel, 1, gridRow);
614614
gridRow++;
615615

src/main/java/de/doubleslash/keeptime/viewPopup/ViewControllerPopup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class ViewControllerPopup {
3030

3131
private static final int LIST_CELL_HEIGHT = 23 + 2;
3232

33-
private final Logger LOG = LoggerFactory.getLogger(this.getClass());
33+
private static final Logger LOG = LoggerFactory.getLogger(ViewControllerPopup.class);
3434

3535
@FXML
3636
private Pane pane;

0 commit comments

Comments
 (0)