Skip to content

Commit ea675ea

Browse files
committed
[abAction]: cleaned up some ab logs. added space support to abLogAndToast.
1 parent 207ed83 commit ea675ea

10 files changed

Lines changed: 16 additions & 18 deletions

File tree

src/ab/abAction/ab/action/portal/abBotMenuAction.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@ if (selectedBot) {
1010
} else {
1111
configBot.tags.sheetPortal = selectedBot.id;
1212
}
13-
14-
ab.log(ab.links.personality.tags.abBuilderIdentity + ": opened bot sheet");
1513
}

src/ab/abAction/ab/action/portal/abMultipleBotMenuAction.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ masks.onPortalChanged = ListenerString(() => {
1111
clearTagMasks(links.currentSheetBots);
1212
clearTagMasks(thisBot);
1313
}
14-
});
15-
16-
ab.log(ab.links.personality.tags.abBuilderIdentity + ": opened multiple select sheet");
14+
});

src/ab/abInterface/ab/interface/menu/abCreateToolboxDropdownOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ menuOptions.artifact = tags.artifact;
2020
if (toolboxTools.length === 0) {
2121
const message = toolboxName + " does not have any tools listed in the tool_array tag";
2222

23-
ab.log(abPersonality.tags.abBuilderIdentity + ": " + message);
23+
ab.log({ name: abPersonality.tags.abBuilderIdentity, message, space: "tempLocal" });
2424
os.toast(message, 5);
2525
console.error(message);
2626
}

src/ab/abInterface/ab/interface/scan/onQRCodeScanned.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if (!builderVersion)
33
return;
44
}
55

6-
ab.log(abPersonality.tags.abBuilderIdentity + ": scanned " + that);
6+
ab.log({ name: abPersonality.tags.abBuilderIdentity, message: "scanned " + that, space: "local" });
77

88
let requestingAI = false;
99
if (configBot.tags.requestingAI) {

src/ab/abPersonality/ab/personality/manifestation/abSetAwake.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ if (tags.abAwake !== awake) {
4949

5050
if (Array.isArray(links.remember.tags.abInitialMessage)) {
5151
for (let i = 0; i < links.remember.tags.abInitialMessage.length; i++) {
52-
ab.log(links.personality.tags.abBuilderIdentity + ": " + links.remember.tags.abInitialMessage[i]);
52+
ab.log({ name: links.personality.tags.abBuilderIdentity, message: links.remember.tags.abInitialMessage[i], space: "shared" });
5353

5454
await os.sleep(2000);
5555
}
5656
}
5757
else {
58-
ab.log(links.personality.tags.abBuilderIdentity + ": " + links.remember.tags.abInitialMessage);
58+
ab.log({ name: links.personality.tags.abBuilderIdentity, message: links.remember.tags.abInitialMessage, space: "shared" });
5959
}
6060
}
6161
}

src/ab/abShell/ab/shell/input/onABCommandsManagerCreated.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ abCommands.addCommand('uuid', () => {
265265
os.setClipboard(uuid());
266266

267267
let message = `Copied new uuid to clipboard`;
268-
ab.log(links.personality.tags.abBuilderIdentity + ': ' + message);
268+
ab.log({ name: links.personality.tags.abBuilderIdentity, message, space: "tempLocal" });
269269
os.toast(message);
270270
}, {
271271
shortDescription: 'Generate a universally unique identifier (uuid) and copy it to the clipboard.',

src/ab/abShell/ab/shell/utils/abLogAndToast.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ let name = abPersonality.tags.abBuilderIdentity;
55
let toast = true;
66
let abLog = true;
77
let consoleLog = true;
8+
let space = "tempLocal";
89

910
if (typeof that === 'string') {
1011
message = that;
@@ -16,22 +17,23 @@ if (typeof that === 'string') {
1617
logType = that.logType ?? logType;
1718
toast = that.toast ?? toast;
1819
abLog = that.abLog ?? abLog;
20+
space = that.space ?? space;
1921
}
2022

2123
if (logType === 'log') {
22-
if (abLog) ab.log(name + ': ' + message);
24+
if (abLog) ab.log({ name, message, space });
2325
if (consoleLog) console.log(name + ': ' + message);
2426
if (toast) os.toast(message, duration);
2527
} else if (logType === 'warning' || logType === 'warn') {
26-
if (abLog) ab.log(name + ': Warning: ' + message);
28+
if (abLog) ab.log({ name, message: 'Warning: ' + message, space });
2729
if (consoleLog) console.warn(name + ': ' + message);
2830
if (toast) os.toast(`Warning: ${message}`, duration);
2931
} else if (logType === 'error') {
30-
if (abLog) ab.log(name + ': Error: ' + message);
32+
if (abLog) ab.log({ name, message: 'Error: ' + message, space });
3133
if (consoleLog) console.error(name + ': ' + message);
3234
if (toast) os.toast(`Error: ${message}`, duration);
3335
} else {
34-
if (abLog) ab.log(name + ': ' + message);
36+
if (abLog) ab.log({ name, message, space });
3537
if (consoleLog) console.log(name + ': ' + message);
3638
if (toast) os.toast(message, duration);
3739
}

src/ab/eggCarton_old/ab/eggCarton/manager/onABInitialized.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Click on me to get a guided tour, or feel free to explore on your own.`;
4444

4545
shout("showConsole");
4646

47-
ab.log(welcomeMessage);
47+
ab.log({ name: abPersonality.tags.abBuilderIdentity, message: welcomeMessage, space: "tempLocal" });
4848

4949
thisBot.onEggMenuCreate();
5050

src/ab/eggCarton_old/ab/eggCarton/manager/onGridClick.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ if (tags.tourPoint != null)
1212

1313
shout("showConsole");
1414

15-
ab.log(welcomeMessage);
15+
ab.log({ name: abPersonality.tags.abBuilderIdentity, message: welcomeMessage, space: "tempLocal" });
1616
}

src/asks/abGenerateToolbox/abGenerateToolbox/wizard/onClick.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (!toolboxName) {
1111
if (toolboxName.includes('.')) {
1212
const message = `Toolbox names cannot have periods in them.`;
1313

14-
ab.log(`${abRemember.tags.abBuilderIdentity}: ${message}`);
14+
ab.log({ name: abPersonality.tags.abBuilderIdentity, message, space: "tempLocal" });
1515
os.toast(message, 5);
1616
console.error(message);
1717
}
@@ -23,7 +23,7 @@ configBot.tags.systemPortalBot = toolboxBot.id;
2323
configBot.tags.systemPortalTag = 'tool_array';
2424

2525
const message = `Created toolbox named '${toolboxName}'. You can find it easily here in the system portal under '${toolboxBot.tags.system}'. Don't forget to fill out the tool_array tag!`
26-
ab.log(`${abRemember.tags.abBuilderIdentity}: ${message}`);
26+
ab.log({ name: abPersonality.tags.abBuilderIdentity, message, space: "tempLocal" });
2727
os.toast(message, 8);
2828
console.log(message);
2929

0 commit comments

Comments
 (0)