Skip to content

Commit 631cf69

Browse files
committed
changing logger method from info to warning.
1 parent e2cad42 commit 631cf69

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

src/main/java/com/browserstack/automate/ci/jenkins/qualityDashboard/QualityDashboardInit.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static void initQDSetupIfRequired() throws JsonProcessingException {
5959
apiUtil.logToQD(browserStackCredentials,"Starting plugin data export to QD");
6060
checkQDIntegrationAndDumpMetaData(browserStackCredentials);
6161
} else {
62-
LOGGER.info("BrowserStack credentials not found. Skipping Quality Dashboard initialization.");
62+
LOGGER.warning("BrowserStack credentials not found. Skipping Quality Dashboard initialization.");
6363
}
6464
} catch (Exception e) {
6565
try {
@@ -143,15 +143,15 @@ private static List<PipelineInfo> getAllPipelines(BrowserStackCredentials browse
143143

144144
} catch (JsonProcessingException e) {
145145
// Handling the exception and logging an error
146-
LOGGER.info("Error processing JSON for job: " + job.getName() + " - " + e.getMessage());
146+
LOGGER.warning("Error processing JSON for job: " + job.getName() + " - " + e.getMessage());
147147
e.printStackTrace();
148148
}
149149
});
150150
} else {
151151
try {
152152
apiUtil.logToQD(browserStackCredentials, "Issue getting Jenkins Instance");
153153
} catch (JsonProcessingException e) {
154-
LOGGER.info("Error logging issue with Jenkins instance.");
154+
LOGGER.warning("Error logging issue with Jenkins instance.");
155155
e.printStackTrace();
156156
}
157157
}
@@ -161,7 +161,7 @@ private static List<PipelineInfo> getAllPipelines(BrowserStackCredentials browse
161161
apiUtil.logToQD(browserStackCredentials,"Total Pipelines detected : " + allPipelines.size());
162162
} catch (JsonProcessingException e) {
163163
// Handling the exception and logging an error
164-
LOGGER.info("Error processing JSON for total pipelines: " + e.getMessage());
164+
LOGGER.warning("Error processing JSON for total pipelines: " + e.getMessage());
165165
e.printStackTrace();
166166
}
167167
// Returning the list of filtered pipelines
@@ -223,7 +223,7 @@ private static List<PipelineDetails> getAllBuilds(BrowserStackCredentials browse
223223
rootUpstreamProject = UpstreamPipelineResolver.resolveRootUpstreamProject(build, browserStackCredentials);
224224
immediateParentProject = UpstreamPipelineResolver.resolveImmediateUpstreamProjectForQEI(build, browserStackCredentials);
225225
} catch (Exception e) {
226-
LOGGER.info("Error resolving upstream project for " + pipelineName + " build number " + buildNumber + ": " + e.getMessage());
226+
LOGGER.warning("Error resolving upstream project for " + pipelineName + " build number " + buildNumber + ": " + e.getMessage());
227227
e.printStackTrace();
228228
}
229229
PipelineDetails pipelineDetail = new PipelineDetails(pipelineName, buildNumber, duration, result,

src/main/java/com/browserstack/automate/ci/jenkins/qualityDashboard/QualityDashboardInitItemListener.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void onCreated(Item job) {
2424
try {
2525
BrowserStackCredentials browserStackCredentials = QualityDashboardUtil.getBrowserStackCreds();
2626
if(browserStackCredentials == null) {
27-
LOGGER.info("BrowserStackCredentials not found. Please ensure they are configured correctly.");
27+
LOGGER.warning("BrowserStackCredentials not found. Please ensure they are configured correctly.");
2828
return;
2929
}
3030
QualityDashboardAPIUtil apiUtil = new QualityDashboardAPIUtil();
@@ -39,7 +39,7 @@ public void onCreated(Item job) {
3939
syncItemListToQD(jsonBody, Constants.QualityDashboardAPI.getItemCrudEndpoint(), "POST");
4040

4141
} catch(Exception e) {
42-
LOGGER.info("Error syncing item creation to Quality Dashboard: " + e.getMessage());
42+
LOGGER.warning("Error syncing item creation to Quality Dashboard: " + e.getMessage());
4343
e.printStackTrace();
4444
}
4545
} else {
@@ -59,7 +59,7 @@ public void onDeleted(Item job) {
5959
String jsonBody = getJsonReqBody(new ItemUpdate(itemName, itemType));
6060
syncItemListToQD(jsonBody, Constants.QualityDashboardAPI.getItemCrudEndpoint(), "DELETE");
6161
} catch(Exception e) {
62-
LOGGER.info("Error syncing item deletion to Quality Dashboard: " + e.getMessage());
62+
LOGGER.warning("Error syncing item deletion to Quality Dashboard: " + e.getMessage());
6363
e.printStackTrace();
6464
}
6565
}
@@ -75,7 +75,7 @@ public void onRenamed(Item job, String oldName, String newName) {
7575
String jsonBody = getJsonReqBody(new ItemRename(oldName, newName, itemType));
7676
syncItemListToQD(jsonBody, Constants.QualityDashboardAPI.getItemCrudEndpoint(), "PUT");
7777
} catch(Exception e) {
78-
LOGGER.info("Error syncing item rename to Quality Dashboard: " + e.getMessage());
78+
LOGGER.warning("Error syncing item rename to Quality Dashboard: " + e.getMessage());
7979
e.printStackTrace();
8080
}
8181
}
@@ -92,7 +92,7 @@ private Response syncItemListToQD(String jsonBody, String url, String typeOfRequ
9292
QualityDashboardAPIUtil apiUtil = new QualityDashboardAPIUtil();
9393
BrowserStackCredentials browserStackCredentials = QualityDashboardUtil.getBrowserStackCreds();
9494
if(browserStackCredentials == null) {
95-
LOGGER.info("BrowserStack credentials not found. Please ensure they are configured correctly.");
95+
LOGGER.warning("BrowserStack credentials not found. Please ensure they are configured correctly.");
9696
return null;
9797
}
9898
if(typeOfRequest.equals("PUT")) {

src/main/java/com/browserstack/automate/ci/jenkins/qualityDashboard/QualityDashboardPipelineTracker.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void onCompleted(Run<?, ?> run, TaskListener listener) {
5757
}
5858
}
5959
else {
60-
LOGGER.info("BrowserStack credentials not found. Please ensure they are configured correctly.");
60+
LOGGER.warning("BrowserStack credentials not found. Please ensure they are configured correctly.");
6161
}
6262
}
6363

@@ -133,7 +133,7 @@ private void sendBuildDataToQD(Run<?, ?> run, Result overallResult, String final
133133
rootUpstreamProject = UpstreamPipelineResolver.resolveRootUpstreamProject(run, browserStackCredentials);
134134
immediateParentProject = UpstreamPipelineResolver.resolveImmediateUpstreamProjectForQEI(run, browserStackCredentials);
135135
} catch (Exception e) {
136-
LOGGER.info("Error resolving upstream project for jobName: " + jobName + " and buildNumber: " + buildNumber + ". Exception: " + e.getMessage());
136+
LOGGER.warning("Error resolving upstream project for jobName: " + jobName + " and buildNumber: " + buildNumber + ". Exception: " + e.getMessage());
137137
e.printStackTrace();
138138
}
139139
Timestamp endTime = new Timestamp(endTimeInMillis);
@@ -191,12 +191,8 @@ private boolean isQDEnabled(BrowserStackCredentials browserStackCredentials) thr
191191
// Check if we have a valid cached value
192192
Boolean cachedResult = QDEnabledCache.getCachedValue();
193193
if (cachedResult != null) {
194-
LOGGER.info("Using cached QD enabled status: " + cachedResult);
195194
return cachedResult;
196195
}
197-
198-
// Cache expired or not set, make API call
199-
LOGGER.info("QD enabled status cache expired or not set, making API call");
200196
Response response = apiUtil.makeGetRequestToQd(Constants.QualityDashboardAPI.getIsQdEnabledEndpoint(), browserStackCredentials);
201197
boolean isEnabled = false;
202198

0 commit comments

Comments
 (0)