Debug Acre Server-Side Code rename
author:
contributor:
published:
updated:
source uri:
Freebase Apps Help Topic /freebase/apps/help_topic
Status:
Summary
The best way to debug Acre server-side code (that is, code in "Template" files or "Script" files,...
Content
The best way to debug Acre server-side code (that is, code in "Template" files or "Script" files, as indicated by the headings in the file pane on the left panel) is to use [`console.log`](http://freebaseapps.com/docs/acre_api/console#member_log).
> console.log("hello");
> console.log(0);
> console.log({ "foo" : "bar", "baz" : [ 1, 4, 9, 16, 25 ] });
> console.log(aVariable);
This function operates on the Acre server and logs whatever you pass to it to a server-side log queue, which can then be viewed in your browser when you view your template or script file by clicking on the button "View with Console". If you already clicked the button "View" instead, then you can force the Acre Console open by adding the parameter `acre.console=1` to the URL.
Note that if you're logging a complex Javascript object, it will be displayed as an expandable/collapsible tree much as such objects are displayed in Firebug or other client-side in-browser object viewer.
> console.log("hello");
> console.log(0);
> console.log({ "foo" : "bar", "baz" : [ 1, 4, 9, 16, 25 ] });
> console.log(aVariable);
This function operates on the Acre server and logs whatever you pass to it to a server-side log queue, which can then be viewed in your browser when you view your template or script file by clicking on the button "View with Console". If you already clicked the button "View" instead, then you can force the Acre Console open by adding the parameter `acre.console=1` to the URL.
Note that if you're logging a complex Javascript object, it will be displayed as an expandable/collapsible tree much as such objects are displayed in Firebug or other client-side in-browser object viewer.
Recent Discussions about Debug Acre Server-Side Code
There is no discussion about this document.
Start the Discussion »