Skip to content

Commit

Permalink
gai: Tweak logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
patniemeyer committed Dec 19, 2024
1 parent ce8a16f commit 38264f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gai-frontend/lib/chat/scripting/chat_scripting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ChatScripting {
final String script;
try {
script = await instance.loadScriptFromURL(url!);
onScriptLoaded("Script loaded from URL: $url");
// onScriptLoaded("Script loaded from URL: $url");
setScript(script);
} catch (e) {
log("Failed to load script from URL: $e");
Expand Down Expand Up @@ -143,7 +143,11 @@ class ChatScripting {
throw Exception("No script to evaluate.");
}
evaluateJS(script!); // We could get a result back async here if needed
onScriptLoaded("Script installed.");
if (url != null) {
onScriptLoaded("Script loaded from URL: ${url!.truncate(32)}");
} else {
onScriptLoaded("Script loaded.");
}
} catch (e, stack) {
log("Failed to evaluate script: $e");
log(stack.toString());
Expand Down

0 comments on commit 38264f9

Please sign in to comment.