Skip to content

Commit

Permalink
Polish logger naming
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Sep 30, 2024
1 parent 72de717 commit f7d7d16
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
public abstract class MoveToSnapshots extends UpgradeDependencies {

private static final Logger log = LoggerFactory.getLogger(MoveToSnapshots.class);
private static final Logger logger = LoggerFactory.getLogger(MoveToSnapshots.class);

@Inject
public MoveToSnapshots(BomExtension bom) {
Expand Down Expand Up @@ -100,8 +100,8 @@ private List<BiPredicate<Library, DependencyVersion>> determineOpenSourceUpdateP
List<Release> releases = scheduledReleases.get(library.getCalendarName());
boolean match = (releases != null)
&& releases.stream().anyMatch((release) -> candidate.isSnapshotFor(release.getVersion()));
if (log.isInfoEnabled() && !match) {
log.info("Ignoring {}. No release of {} scheduled before {}", candidate, library.getName(),
if (logger.isInfoEnabled() && !match) {
logger.info("Ignoring {}. No release of {} scheduled before {}", candidate, library.getName(),
milestone.getDueOn());
}
return match;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
class MultithreadedLibraryUpdateResolver implements LibraryUpdateResolver {

private static final Logger LOGGER = LoggerFactory.getLogger(MultithreadedLibraryUpdateResolver.class);
private static final Logger logger = LoggerFactory.getLogger(MultithreadedLibraryUpdateResolver.class);

private final int threads;

Expand All @@ -55,7 +55,7 @@ class MultithreadedLibraryUpdateResolver implements LibraryUpdateResolver {
@Override
public List<LibraryWithVersionOptions> findLibraryUpdates(Collection<Library> librariesToUpgrade,
Map<String, Library> librariesByName) {
LOGGER.info("Looking for updates using {} threads", this.threads);
logger.info("Looking for updates using {} threads", this.threads);
ExecutorService executorService = Executors.newFixedThreadPool(this.threads);
try {
return librariesToUpgrade.stream().map((library) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
class StandardLibraryUpdateResolver implements LibraryUpdateResolver {

private static final Logger LOGGER = LoggerFactory.getLogger(StandardLibraryUpdateResolver.class);
private static final Logger logger = LoggerFactory.getLogger(StandardLibraryUpdateResolver.class);

private final VersionResolver versionResolver;

Expand All @@ -63,11 +63,11 @@ public List<LibraryWithVersionOptions> findLibraryUpdates(Collection<Library> li
if (isLibraryExcluded(library)) {
continue;
}
LOGGER.info("Looking for updates for {}", library.getName());
logger.info("Looking for updates for {}", library.getName());
long start = System.nanoTime();
List<VersionOption> versionOptions = getVersionOptions(library);
result.add(new LibraryWithVersionOptions(library, versionOptions));
LOGGER.info("Found {} updates for {}, took {}", versionOptions.size(), library.getName(),
logger.info("Found {} updates for {}, took {}", versionOptions.size(), library.getName(),
Duration.ofNanos(System.nanoTime() - start));
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
public abstract class MavenExec extends JavaExec {

private final Logger log = LoggerFactory.getLogger(MavenExec.class);
private final Logger logger = LoggerFactory.getLogger(MavenExec.class);

public MavenExec() {
setClasspath(mavenConfiguration(getProject()));
Expand All @@ -69,8 +69,8 @@ public void exec() {
try {
args("--log-file", logFile.toFile().getAbsolutePath());
super.exec();
if (this.log.isInfoEnabled()) {
Files.readAllLines(logFile).forEach(this.log::info);
if (this.logger.isInfoEnabled()) {
Files.readAllLines(logFile).forEach(this.logger::info);
}
}
catch (ExecException ex) {
Expand Down

0 comments on commit f7d7d16

Please sign in to comment.