@forge/bundler 4.6.1-next.3 → 4.6.1-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/out/stubs/log-events.d.ts.map +1 -1
- package/out/stubs/log-events.js +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-events.d.ts","sourceRoot":"","sources":["../../src/stubs/log-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log-events.d.ts","sourceRoot":"","sources":["../../src/stubs/log-events.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AACtD,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,wBAAgB,cAAc,IAAI,MAAM,CAavC;AA4CD,aAAK,SAAS;IACZ,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AA0CD,wBAAgB,eAAe,CAAC,WAAW,EAAE,GAAG;;;;EAE/C;AAED,wBAAgB,yBAAyB;;;;EAExC;AAED,wBAAgB,qBAAqB;;;;EAEpC;AAED,wBAAgB,cAAc,CAAC,YAAY,EAAE,GAAG;;;;EAG/C"}
|
package/out/stubs/log-events.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.emitErrorEvent = exports.emitFailedFooterEvent = exports.emitSuccessfulF
|
|
|
4
4
|
const api_1 = require("@forge/api");
|
|
5
5
|
const bunyan_1 = require("bunyan");
|
|
6
6
|
const console_1 = require("./console");
|
|
7
|
+
const runtime_1 = require("@forge/runtime");
|
|
7
8
|
exports.AWS_EXECUTION_ENV_PREFIX = 'AWS_Lambda_';
|
|
8
9
|
exports.RUNTIME_NAME_FALLBACK = 'node';
|
|
9
10
|
function getRuntimeName() {
|
|
@@ -81,6 +82,16 @@ function simpleBunyanLogEvent(eventType, eventLevel, data) {
|
|
|
81
82
|
process.stdout.write(JSON.stringify(logEvent) + '\n');
|
|
82
83
|
return logEvent;
|
|
83
84
|
}
|
|
85
|
+
function logErrorToTunnelProcess(caughtObject) {
|
|
86
|
+
if (global.__forge_tunnel__) {
|
|
87
|
+
const logEventData = {
|
|
88
|
+
invocationId: (0, api_1.getRuntime)().lambdaContext.awsRequestId,
|
|
89
|
+
logLevel: runtime_1.LogLevel.ERROR,
|
|
90
|
+
logArguments: [caughtObject]
|
|
91
|
+
};
|
|
92
|
+
process.stdout.write(JSON.stringify((0, console_1.starSerializer)(logEventData)) + '\n');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
84
95
|
function emitHeaderEvent(lambdaEvent) {
|
|
85
96
|
return simpleBunyanLogEvent(EventType.HEADER, bunyan_1.levelFromName.info, invocationHeaderLogs(lambdaEvent));
|
|
86
97
|
}
|
|
@@ -94,6 +105,7 @@ function emitFailedFooterEvent() {
|
|
|
94
105
|
}
|
|
95
106
|
exports.emitFailedFooterEvent = emitFailedFooterEvent;
|
|
96
107
|
function emitErrorEvent(caughtObject) {
|
|
108
|
+
logErrorToTunnelProcess(caughtObject);
|
|
97
109
|
return simpleBunyanLogEvent(EventType.LOG, bunyan_1.levelFromName.error, caughtObject);
|
|
98
110
|
}
|
|
99
111
|
exports.emitErrorEvent = emitErrorEvent;
|