diff --git a/backend/broker.ts b/backend/broker.ts
index 391235b..5cbee8d 100644
--- a/backend/broker.ts
+++ b/backend/broker.ts
@@ -22,7 +22,7 @@ export function executeCommand(): void {
exec('iching divine', (error, stdout, stderr) => {
- console.log(`Begin`);
+ console.log(`I-Ching-Broker: \'iching divine\' called`);
if (error) {
console.error(`Error: ${error.message}`);
@@ -39,7 +39,7 @@ export function executeCommand(): void {
config = loadConfig();
} */
- console.log(`Send E-Mail`);
+ console.log(`Horoscope received; sending E-Mail next`);
sendEmail(stdout);
});
}
@@ -75,9 +75,11 @@ async function sendEmail(content: string) {
html: html(content)
});
- console.log("E-Mail sent: ", info.messageId + "\n");
+ console.log("E-Mail sent: ", info.messageId + "\n\n");
} catch (error) {
- console.error("Error Sending E-Mail:", error);
+ console.error("Error Sending E-Mail:", error + "\n\n");
+
+ console.log("Failed to send horoscope: \n", content + "\n");
}
}
@@ -119,7 +121,7 @@ function parse(input: string): Node {
const changingLines: Node = { type: "ChangingLines"};
currentNode.child = changingLines;
currentNode = changingLines;
- currentNode.value = line; // + "
"; TODO: try without this
+ currentNode.value = line;
} else {
currentNode.value = currentNode.value + line + "
";
}
@@ -132,13 +134,11 @@ function parse(input: string): Node {
function render(node: Node): string {
if (node == undefined) {
- console.log("Rendering of nodes finished!")
+ console.log("I-Ching-Broker: Rendering of nodes finished!")
return "";
}
- console.log("Render node" + node.type);
-
var outputHTML: string = "";
switch (node.type) {
@@ -161,7 +161,6 @@ function render(node: Node): string {
case "ChangingLines" :
const regex = new RegExp("~", "g");
node.value = node.value?.replace(regex, "");
- //outputHTML = "
Click on the Button to receive your personal Horoscope. 100% accuracy guaranteed!
- +