Skip to content

Commit 85d15b5

Browse files
committed
Remove unnecessary .getName()s on logger creation
As SLF4J allows passing in a `Class<?>`, instead of a `String` for the class name, we can simplify interactions with the logger creations.
1 parent a8b01b8 commit 85d15b5

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

lib/src/main/java/com/diffplug/spotless/FormatExceptionPolicyLegacy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class FormatExceptionPolicyLegacy extends NoLambda.EqualityBasedOnSerialization implements FormatExceptionPolicy {
2222
private static final long serialVersionUID = 1L;
2323

24-
private static final Logger logger = LoggerFactory.getLogger(Formatter.class.getName());
24+
private static final Logger logger = LoggerFactory.getLogger(Formatter.class);
2525

2626
@Override
2727
public void handleError(Throwable e, FormatterStep step, String relativePath) {

lib/src/main/java/com/diffplug/spotless/markdown/FreshMarkStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private static class State implements Serializable {
8080
}
8181

8282
FormatterFunc createFormat() throws Exception {
83-
Logger logger = LoggerFactory.getLogger(FreshMarkStep.class.getName());
83+
Logger logger = LoggerFactory.getLogger(FreshMarkStep.class);
8484
Consumer<String> loggingStream = logger::warn;
8585

8686
ClassLoader classLoader = jarState.getClassLoader();

lib/src/main/java/com/diffplug/spotless/npm/NpmFormatterStepStateBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
abstract class NpmFormatterStepStateBase implements Serializable {
4040

41-
private static final Logger logger = LoggerFactory.getLogger(NpmFormatterStepStateBase.class.getName());
41+
private static final Logger logger = LoggerFactory.getLogger(NpmFormatterStepStateBase.class);
4242

4343
private static final long serialVersionUID = 1460749955865959948L;
4444

lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
public class PrettierFormatterStep {
3939

40-
private static final Logger logger = LoggerFactory.getLogger(PrettierFormatterStep.class.getName());
40+
private static final Logger logger = LoggerFactory.getLogger(PrettierFormatterStep.class);
4141

4242
public static final String NAME = "prettier-format";
4343

lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
public class TsFmtFormatterStep {
3838

39-
private static final Logger logger = LoggerFactory.getLogger(TsFmtFormatterStep.class.getName());
39+
private static final Logger logger = LoggerFactory.getLogger(TsFmtFormatterStep.class);
4040

4141
public static final String NAME = "tsfmt-format";
4242

lib/src/sortPom/java/com/diffplug/spotless/glue/pom/SortPomFormatterFunc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import sortpom.parameter.PluginParameters;
3232

3333
public class SortPomFormatterFunc implements FormatterFunc {
34-
private static final Logger logger = LoggerFactory.getLogger(SortPomFormatterFunc.class.getName());
34+
private static final Logger logger = LoggerFactory.getLogger(SortPomFormatterFunc.class);
3535
private final SortPomCfg cfg;
3636

3737
public SortPomFormatterFunc(SortPomCfg cfg) {

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GradleProvisioner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private static Provisioner forConfigurationContainer(Project project, Configurat
137137
};
138138
}
139139

140-
private static final Logger logger = LoggerFactory.getLogger(GradleProvisioner.class.getName());
140+
private static final Logger logger = LoggerFactory.getLogger(GradleProvisioner.class);
141141

142142
/** Models a request to the provisioner. */
143143
private static class Request {

0 commit comments

Comments
 (0)