Skip to content

Commit

Permalink
refactor: rename logger (#2065)
Browse files Browse the repository at this point in the history
  • Loading branch information
bossenti authored Oct 21, 2023
1 parent 19efa05 commit 6a388e8
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
public class WorkerRestClient {

private static final Logger logger = LoggerFactory.getLogger(WorkerRestClient.class);
private static final Logger LOG = LoggerFactory.getLogger(WorkerRestClient.class);

public static void invokeStreamAdapter(String endpointUrl,
String elementId) throws AdapterException {
Expand All @@ -72,7 +72,7 @@ public static void stopStreamAdapter(String baseUrl,

public static List<AdapterDescription> getAllRunningAdapterInstanceDescriptions(String url) throws AdapterException {
try {
logger.info("Requesting all running adapter description instances: " + url);
LOG.info("Requesting all running adapter description instances: " + url);
var responseString = ExtensionServiceExecutions
.extServiceGetRequest(url)
.execute().returnContent().asString();
Expand All @@ -81,22 +81,22 @@ public static List<AdapterDescription> getAllRunningAdapterInstanceDescriptions(

return result;
} catch (IOException e) {
logger.error("List of running adapters could not be fetched", e);
LOG.error("List of running adapters could not be fetched", e);
throw new AdapterException("List of running adapters could not be fetched from: " + url);
}
}

public static void startAdapter(String url,
AdapterDescription ad) throws AdapterException {
logger.info("Trying to start adapter on endpoint {} ", url);
LOG.info("Trying to start adapter on endpoint {} ", url);
triggerAdapterStateChange(ad, url, "started");
}


public static void stopAdapter(AdapterDescription ad,
String url) throws AdapterException {

logger.info("Trying to stop adapter on endpoint {} ", url);
LOG.info("Trying to stop adapter on endpoint {} ", url);
triggerAdapterStateChange(ad, url, "stopped");
}

Expand All @@ -114,10 +114,10 @@ private static void triggerAdapterStateChange(AdapterDescription ad,
throw new AdapterException(exception.getMessage(), exception.getCause());
}

logger.info("Adapter {} on endpoint: " + url + " with Response: ", ad.getName() + responseString);
LOG.info("Adapter {} on endpoint: " + url + " with Response: ", ad.getName() + responseString);

} catch (IOException e) {
logger.error("Adapter was not {} successfully", action, e);
LOG.error("Adapter was not {} successfully", action, e);
throw new AdapterException("Adapter was not " + action + " successfully with url " + url, e);
}
}
Expand Down Expand Up @@ -161,15 +161,15 @@ public static RuntimeOptionsResponse getConfiguration(String workerEndpoint,

public static String getAssets(String workerPath) throws AdapterException {
String url = workerPath + "/assets";
logger.info("Trying to Assets from endpoint: " + url);
LOG.info("Trying to Assets from endpoint: " + url);

try {
return Request.Get(url)
.connectTimeout(1000)
.socketTimeout(100000)
.execute().returnContent().asString();
} catch (IOException e) {
logger.error(e.getMessage());
LOG.error(e.getMessage());
throw new AdapterException("Could not get assets endpoint: " + url);
}

Expand All @@ -185,7 +185,7 @@ public static byte[] getIconAsset(String baseUrl) throws AdapterException {
.execute().returnContent().asBytes();
return responseString;
} catch (IOException e) {
logger.error(e.getMessage());
LOG.error(e.getMessage());
throw new AdapterException("Could not get icon endpoint: " + url);
}
}
Expand All @@ -199,7 +199,7 @@ public static String getDocumentationAsset(String baseUrl) throws AdapterExcepti
.socketTimeout(100000)
.execute().returnContent().asString();
} catch (IOException e) {
logger.error(e.getMessage());
LOG.error(e.getMessage());
throw new AdapterException("Could not get documentation endpoint: " + url);
}
}
Expand Down

0 comments on commit 6a388e8

Please sign in to comment.