[
https://issues.apache.org/jira/browse/TINKERPOP3-679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14543757#comment-14543757
]
Matt Frantz commented on TINKERPOP3-679:
----------------------------------------
Console logging is tempting, but it might be more useful to formalize and
capture this information and make it available in the {{Traversal}} API. One
could then use it to write unit tests, asserts, etc. These "tracing" data
structures could be focused on a particular aspect, e.g. a {{List}} of the
class objects that captures the order of application of strategies.
That said, a specific log4j switch would be familiar and capable enough.
There are also potential debug modes for execution, e.g. something that records
the contents of the {{Traverser}} after specific steps, but that probably
deserves its own ticket.
> Debuggable Traversal
> --------------------
>
> Key: TINKERPOP3-679
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-679
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Reporter: stephen mallette
> Fix For: 3.0.0.GA
>
>
> I'd like to be able to put a {{Traversal}} into "debug mode".
> {{TraversalStrategy}} application is a bit too mysterious, making it hard to
> figure out why a {{Traversal}} is failing. In a recent debug session, the
> problem was only sorted out after we looked at the order in which strategies
> were applied and even then it was a bit tricky to really understand what was
> happening.
> If the {{Traversal}} were in this "debug mode" it could give us insight into
> that strategy application process which would mean at least the following:
> * Display the order in which strategies were applied
> * For each strategy applied, display the {{toString()}} of the {{Traversal}}
> at that stage.
> A developer could then logically see what's in the magic and recognize that
> strategy 7 is ovewriting what strategy 2 is doing or that strategy 4 is
> executing before strategy 3 somehow.
> Not sure what the best way is to implement this. A straightforward solution
> with an environment variable check and println in {{applyStrategies}} seemed
> too "cheap" though kinda nice because very little would change and that
> output would come as part of the standard {{Traversal}} execution. Other
> (better) ways?
> I put this in for GA, but I guess it doesn't have to be there - we can drop
> it if it gets crazy.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)