Skip to content

Commit

Permalink
Remove unnecessary .getName()s on logger creation
Browse files Browse the repository at this point in the history
As SLF4J allows passing in a `Class<?>`, instead of a `String` for the
class name, we can simplify interactions with the logger creations.
  • Loading branch information
jamietanna committed Feb 15, 2022
1 parent a8b01b8 commit 85d15b5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class FormatExceptionPolicyLegacy extends NoLambda.EqualityBasedOnSerialization implements FormatExceptionPolicy {
private static final long serialVersionUID = 1L;

private static final Logger logger = LoggerFactory.getLogger(Formatter.class.getName());
private static final Logger logger = LoggerFactory.getLogger(Formatter.class);

@Override
public void handleError(Throwable e, FormatterStep step, String relativePath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static class State implements Serializable {
}

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

ClassLoader classLoader = jarState.getClassLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

abstract class NpmFormatterStepStateBase implements Serializable {

private static final Logger logger = LoggerFactory.getLogger(NpmFormatterStepStateBase.class.getName());
private static final Logger logger = LoggerFactory.getLogger(NpmFormatterStepStateBase.class);

private static final long serialVersionUID = 1460749955865959948L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

public class PrettierFormatterStep {

private static final Logger logger = LoggerFactory.getLogger(PrettierFormatterStep.class.getName());
private static final Logger logger = LoggerFactory.getLogger(PrettierFormatterStep.class);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

public class TsFmtFormatterStep {

private static final Logger logger = LoggerFactory.getLogger(TsFmtFormatterStep.class.getName());
private static final Logger logger = LoggerFactory.getLogger(TsFmtFormatterStep.class);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import sortpom.parameter.PluginParameters;

public class SortPomFormatterFunc implements FormatterFunc {
private static final Logger logger = LoggerFactory.getLogger(SortPomFormatterFunc.class.getName());
private static final Logger logger = LoggerFactory.getLogger(SortPomFormatterFunc.class);
private final SortPomCfg cfg;

public SortPomFormatterFunc(SortPomCfg cfg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private static Provisioner forConfigurationContainer(Project project, Configurat
};
}

private static final Logger logger = LoggerFactory.getLogger(GradleProvisioner.class.getName());
private static final Logger logger = LoggerFactory.getLogger(GradleProvisioner.class);

/** Models a request to the provisioner. */
private static class Request {
Expand Down

0 comments on commit 85d15b5

Please sign in to comment.