Select to view content in your preferred language

Debugging Attribute Rules using Console() in ArcGIS Pro

448
6
Jump to solution
04-22-2024 02:21 AM
LucVanDijk
New Contributor II

Hi Esri community!

I have a question concerning the debugging of Attribute Rules in ArcGIS Pro 3.2. Various sources from Esri (documentation pages, community blogs and youtube video's) recommend writing variables and messages to the console using Console() when debugging your Arcade expressions. However, I can't seem to find the Console anywhere. Where are the messages sent to? How can I find the Console in ArcGIS Pro?

I have tried using the Arcade Playground to test parts of my code, but it can be difficult to replicate my data in there. Also, the Expression Builder has the 'Validate' button (green checkmark), which will output the result of the expression for one feature, including console messages. However, this is insufficient for proper debugging.

Your help is appreciated!

0 Kudos
1 Solution

Accepted Solutions
CodyPatterson
Regular Contributor

Hey @LucVanDijk 

This link may help out, a solution states that it's not possible since ESRI didn't redirect the STDOUT to anywhere, but the solution underneath shows a way to perform this within a Calculate Field. I've used this before by creating a blank Feature Class with a few columns to create this test area, here is the link for that:

https://community.esri.com/t5/arcgis-pro-questions/where-do-the-arcade-console-messages-go-to/td-p/1...

And here is a screenshot of my efforts here:

CodyPatterson_0-1713784367176.png

This has helped me debug a few non-calculate field related issues, and it may be strange but this seems to be the only way to do it that I can find!

Hope that helps!

Cody

View solution in original post

6 Replies
CodyPatterson
Regular Contributor

Hey @LucVanDijk 

This link may help out, a solution states that it's not possible since ESRI didn't redirect the STDOUT to anywhere, but the solution underneath shows a way to perform this within a Calculate Field. I've used this before by creating a blank Feature Class with a few columns to create this test area, here is the link for that:

https://community.esri.com/t5/arcgis-pro-questions/where-do-the-arcade-console-messages-go-to/td-p/1...

And here is a screenshot of my efforts here:

CodyPatterson_0-1713784367176.png

This has helped me debug a few non-calculate field related issues, and it may be strange but this seems to be the only way to do it that I can find!

Hope that helps!

Cody

LucVanDijk
New Contributor II

Thanks Cody. Too bad Esri hasn't worked this out yet. I suppose I could use this workaround until then. I will update this thread if I've found any better methods.  🙂

MikeMillerGIS
Esri Frequent Contributor

Console messages were added to the debug log in the ArcGIS Pro Diagnostics.  I do not recall what version, might have been 3.2.  I can see if I can find the version.

0 Kudos
LucVanDijk
New Contributor II

I have tried looking for the Console messages in the Diagnostic Monitor (Ctrl+Alt+M in ArcGIS Pro) after running the Evaluate Rules tool. With the Debug checkbox checked, the Log tab is populated with a bunch of information, but I was not able to find my Console messages in there. The Filter search box is not of much help, and I have trouble understanding the information in this window. See screenshot;

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

If you are using services, you need to check the ArcGIS Server log as the rules are run the GDB and arcgis pro does not have access to their execution.  

HusseinNasser2
Esri Contributor

To add to this thread, when using Console with attribute rules we write a debug entry in both server manager logs and ArcGIS Pro Monitor diagnostics. This helps tremendously in debugging. Here is a simple example

HusseinNasser2_0-1714061950149.png

 

 

This was first introduced in Pro 3.2/11.2 and the fix has been ported to the following patches

- ArcGIS Pro 3.0.6

- ArcGIS Pro  3.1.3

- ArcGIS Pro 2.9.11

- ArcGIS Server 10.8.1 Utility Network and Data Management Patch 11

- ArcGIS Server 10.9.1 Utility Network and Data Management Patch 6

- ArcGIS Server 11.1 Utility Network and Data Management Patch 2