Skip to content

'debug' module

Matias Guijarro requested to merge debug_trace into master

This merge request adds a new debug module in bliss.common.

The debug module has 2 public functions:

  • trace(on=True, output_file=None, file_mode="wa")
    • if on is True, uses Python profiling hook to set a profiling function that prints elapsed time, filename, line number for any subsequent execution for code within the BLISS project itself
    • an optional output_file can be given, in this case stdout is also duplicated to this file for easier debugging (trace + output)
    • output file mode can be specified, by default the output file grows
    • calling .trace(False) removes the trace function
  • step_into(func, *args, **kwargs)
    • calls function func with arguments
    • enters pdb at the first line of func
    • solves #271 (closed)

About trace(): the idea here is to have a generic trace function for internal BLISS calls, but it would be good to solve #368 (closed) as well.

Merge request reports