Problem/Motivation
Sometimes it is useful to get all the debugging information this module provides, but sometimes I want to debug the processing of just one field. This module gives me too much information (all the other fields) and not enough (only the source values for the process pipeline).
I sometimes want to see what is happening during each step in the process pipeline for a single field.
Proposed resolution
Add a debug process plugin, similar to the log plugin provided by core. Instead of saving messages, show them with print_r(). Then I can debug my process pipelines by adding
-
plugin: debug
as needed.
This has a few advantages over using the core log plugin:
- Using
print_r() handles both arrays and strings gracefully.
- It is easier to distinguish debugging code that should be removed from logging code that should stay.
- It saves a step: no need to use
drush mmsg my_migration to see the messages.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
benjifisherHere is a patch with the plugin I have been using. I just added the
multipleoption and have not tested it, yet.Comment #3
selwynpolit commented@benjifisher, this seems like a very useful plugin. I noticed one small issue. The namespace line should be:
Also I found it useful to add a little more to the output so the person using the plugin could clearly identify the "debug output: "
Comment #4
selwynpolit commentedComment #5
benjifisher@selwynpolit:
Oops, thanks for catching the namespace problem.
Good idea for adding a label. Let's make it more flexible by adding a new (optional)
labelparameter. Then you can leave it off if you do not care, or distinguish between different steps in the pipeline (if you are adding thedebugplugin in more than one place).I have attached an updated patch.
Comment #6
selwynpolit commented@benjifisher That works great. I like the customizable label option.
Comment #7
selwynpolit commentedComment #9
Derimagia commentedThanks - Sorry for the delay, commited
Comment #10
benjifisher@Derimagia:
No worries. Thanks for the module!