Skip to content

Commit 5dc164b

Browse files
authored
Merge pull request #128 from atlanhq/add-logging-for-visibility
AM-1586 added logs for visibility
2 parents a249a6b + 8b94ced commit 5dc164b

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed

adapters/integrations/gitlab-integration.js

+21-7
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,29 @@ ${content}`;
765765
headSHA,
766766
});
767767

768+
logger.withInfo(
769+
`Successfully fetched file contents. File size: ${fileContents.length} bytes`,
770+
integrationName,
771+
CI_COMMIT_SHA,
772+
"getAssetName"
773+
);
774+
768775
if (fileContents) {
776+
logger.withInfo(
777+
"Starting regex matching",
778+
integrationName,
779+
CI_COMMIT_SHA,
780+
"getAssetName"
781+
);
769782
var matches = regExp.exec(fileContents);
783+
784+
logger.withInfo(
785+
"Successfully executed regex matching",
786+
integrationName,
787+
CI_COMMIT_SHA,
788+
"getAssetName"
789+
);
790+
770791
if (matches) {
771792
logger.withInfo(
772793
`Found a match: ${matches[1].trim()}`,
@@ -813,13 +834,6 @@ ${content}`;
813834
);
814835
const buff = Buffer.from(content, "base64");
815836

816-
logger.withInfo(
817-
"Successfully fetched file contents",
818-
integrationName,
819-
CI_COMMIT_SHA,
820-
"getFileContents"
821-
);
822-
823837
return buff.toString("utf8");
824838
} catch (error) {
825839
logger.withError(

dist/index.js

+21-7
Original file line numberDiff line numberDiff line change
@@ -34789,8 +34789,29 @@ ${content}`;
3478934789
headSHA,
3479034790
});
3479134791

34792+
logger_logger.withInfo(
34793+
`Successfully fetched file contents. File size: ${fileContents.length} bytes`,
34794+
gitlab_integration_integrationName,
34795+
CI_COMMIT_SHA,
34796+
"getAssetName"
34797+
);
34798+
3479234799
if (fileContents) {
34800+
logger_logger.withInfo(
34801+
"Starting regex matching",
34802+
gitlab_integration_integrationName,
34803+
CI_COMMIT_SHA,
34804+
"getAssetName"
34805+
);
3479334806
var matches = regExp.exec(fileContents);
34807+
34808+
logger_logger.withInfo(
34809+
"Successfully executed regex matching",
34810+
gitlab_integration_integrationName,
34811+
CI_COMMIT_SHA,
34812+
"getAssetName"
34813+
);
34814+
3479434815
if (matches) {
3479534816
logger_logger.withInfo(
3479634817
`Found a match: ${matches[1].trim()}`,
@@ -34837,13 +34858,6 @@ ${content}`;
3483734858
);
3483834859
const buff = Buffer.from(content, "base64");
3483934860

34840-
logger_logger.withInfo(
34841-
"Successfully fetched file contents",
34842-
gitlab_integration_integrationName,
34843-
CI_COMMIT_SHA,
34844-
"getFileContents"
34845-
);
34846-
3484734861
return buff.toString("utf8");
3484834862
} catch (error) {
3484934863
logger_logger.withError(

0 commit comments

Comments
 (0)