Skip to content

Commit 9cfb96e

Browse files
feat: add application logs
1 parent c2ce92d commit 9cfb96e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dapp/src/executeTask.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async function processProtectedData({
5959
result.success = false;
6060
result.error = e.message;
6161
}
62+
console.log(`Protected data ${index} processed:`, result);
6263
return result;
6364
}
6465

@@ -96,6 +97,7 @@ async function start() {
9697

9798
// Process multiple protected data
9899
if (bulkSize > 0) {
100+
console.log(`Processing ${bulkSize} protected data...`);
99101
const processPromises = new Array(bulkSize).fill(null).map((_, index) =>
100102
processProtectedData({
101103
index: index + 1,
@@ -121,6 +123,7 @@ async function start() {
121123
})),
122124
};
123125
} else {
126+
console.log('Processing single protected data...');
124127
const { protectedData, success, error } = await processProtectedData({
125128
index: 0,
126129
IEXEC_IN,
@@ -130,9 +133,11 @@ async function start() {
130133
result = { protectedData, success, error };
131134
}
132135
} catch (e) {
136+
console.error('Something went wrong:', e.message);
133137
result = { success: false, error: e.message };
134138
}
135139

140+
console.log('Writing results:', JSON.stringify(result));
136141
await fs.writeFile(
137142
`${workerEnv.IEXEC_OUT}/result.json`,
138143
JSON.stringify(result, null, 2)

0 commit comments

Comments
 (0)