Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logs): remove logger abstraction #348

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());

mwangggg marked this conversation as resolved.
Show resolved Hide resolved
@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
Loading