Skip to content

Commit

Permalink
remove logger abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Feb 14, 2024
1 parent 2624d9b commit 7a44ca6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 134 deletions.
124 changes: 0 additions & 124 deletions src/main/java/io/cryostat/core/log/Logger.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.openjdk.jmc.jdp.client.DiscoveryListener;
import org.openjdk.jmc.jdp.client.JDPClient;

import io.cryostat.core.log.Logger;
import org.slf4j.Logger;

public class JvmDiscoveryClient {

Expand Down Expand Up @@ -67,6 +67,7 @@ public void onDiscovery(DiscoveryEvent evt) {
break;
default:
logger.error(
"Exception thrown",
new IllegalArgumentException(evt.getKind().toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@
import org.openjdk.jmc.flightrecorder.rules.TypedResult;
import org.openjdk.jmc.flightrecorder.rules.util.RulesToolkit;

import io.cryostat.core.log.Logger;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.io.input.CountingInputStream;
import org.slf4j.Logger;

/**
* Re-implementation of {@link ReportGenerator} where the report generation task is represented by a
Expand Down Expand Up @@ -219,7 +218,7 @@ private Pair<Collection<IResult>, Long> generateResultHelper(
f.cancel(true);
}
}
logger.warn(e);
logger.warn("Exception thrown", e);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,19 @@
import org.openjdk.jmc.rjmx.services.jfr.IFlightRecorderService;

import io.cryostat.core.FlightRecorderException;
import io.cryostat.core.log.Logger;
import io.cryostat.core.net.JFRConnection;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.parser.Parser;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RemoteTemplateService extends AbstractTemplateService {

private final Logger logger = LoggerFactory.getLogger(getClass());
private final JFRConnection conn;

public RemoteTemplateService(JFRConnection conn) {
Expand Down Expand Up @@ -129,7 +131,7 @@ protected List<XMLModel> getTemplateModels() throws FlightRecorderException {
try {
return EventConfiguration.createModel(xmlText);
} catch (ParseException | IOException e) {
Logger.INSTANCE.warn(e);
logger.warn("Exception thrown", e);
return null;
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.openjdk.jmc.jdp.client.DiscoveryListener;
import org.openjdk.jmc.jdp.client.JDPClient;

import io.cryostat.core.log.Logger;
import io.cryostat.core.net.discovery.JvmDiscoveryClient.EventKind;

import org.hamcrest.MatcherAssert;
Expand All @@ -42,13 +41,15 @@
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ExtendWith(MockitoExtension.class)
class JvmDiscoveryClientTest {

JvmDiscoveryClient client;
@Mock JDPClient jdp;
@Mock Logger logger;
@Mock Logger logger = LoggerFactory.getLogger(getClass());

@BeforeEach
void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import io.cryostat.core.log.Logger;
import io.cryostat.core.reports.InterruptibleReportGenerator.AnalysisResult;

import org.hamcrest.MatcherAssert;
Expand All @@ -35,12 +34,15 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ExtendWith(MockitoExtension.class)
class InterruptibleReportGeneratorTest {

@Mock InputStream recording;
@Mock Logger logger;
@Mock Logger logger = LoggerFactory.getLogger(getClass());

InterruptibleReportGenerator generator;

@BeforeEach()
Expand Down

0 comments on commit 7a44ca6

Please sign in to comment.