Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ccm} Add tracing feature #13

Closed
asmaloney opened this issue Aug 11, 2021 · 3 comments
Closed

{ccm} Add tracing feature #13

asmaloney opened this issue Aug 11, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@asmaloney
Copy link
Owner

It would be useful to trace the changes in buffers as production rules fire.

As far as I can tell, right now this isn't possible "out of the box" without modifying ccm because we don't have a get() method on Buffer.

If we had that method, we could add something like this to the productions:

print('[start] goal: "' + str(goal.get()) + '" retrieve: "' + str(retrieve.get()) + '"')

to get some useful trace output:

[start] goal: "countFrom 2 5 counting" retrieve: "None"
2
[increment] goal: "countFrom 3 5 counting" retrieve: "count 2 3"
3
[increment] goal: "countFrom 4 5 counting" retrieve: "count 3 4"
4
[increment] goal: "countFrom 5 5 counting" retrieve: "count 4 5"
5
[stop] goal: "None" retrieve: "count 5 6"
end...

(Side note: I tried making a method trace() to be called for each production, but the way the ccm is implemented it doesn't seem to be possible. So it means outputting the print call directly at the end of each production.

@asmaloney asmaloney added the enhancement New feature or request label Aug 11, 2021
@asmaloney asmaloney changed the title Add tracing feature {ccm} Add tracing feature Aug 15, 2021
@asmaloney
Copy link
Owner Author

Note that this is about the ccm framework. The other two output the trace by default.

@asmaloney
Copy link
Owner Author

ccm's logging may help here. Need to figure out if there are different levels, but just turning on logging in the amod file gives this which is a start:

ccm
---
   0.000 production initialRetrieval
   0.050 production None
   0.100 production chainCategory
   0.150 production None
   0.200 production directVerify
   0.250 production None
Yes
end...

@asmaloney
Copy link
Owner Author

Can now do this by adjusting the logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant