0

I have different code in my tests that needs to execute based on whether or not a plugin is loaded.

If the plugin is loaded, it should redirect all the output from the program to a named pipe so the plugin can capture it for logging. If it is not loaded, then the program should open a terminal window with a 'tail -f' on the named pipe so that I can view the output.

Alternatively, a way to read from the pipe and put the read data back into it or into a new pipe would solve my problem. I've tried tee-ing the output to another pipe, but it didn't seem to work, no data would be read from the second pipe. This, of course, could have been user error.

Thanks!

JD Russo
  • 422
  • 1
  • 5
  • 9

1 Answers1

0

You can always inject import pdb; pdb.set_trace() within a plugin itself within the config method of plugin. There would be something like this:

if condition_to_enable_plugin:
    #this is the place to put breakpoint, print, etc
    self.enabled = True

Do not forget to run with -s flag to make sure you can communicate with debugger and stdout is not hidden from you.

Oleksiy
  • 6,337
  • 5
  • 41
  • 58