Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

PTL's create_import_hook(), by default, prints hook's content in the test output. This is a useful information in the test output. But in scenarios where the hook body is very large, (For example cgroups hook with 4500+ lines) the test output becomes unmanageable.  Hence an option will be added to create_import_hook() and import_hook() methods to suppress logging hook body, if needed. Test writers can choose to suppress hook contents if needed.

Forum Discussion

http://community.pbspro.org/t/option-to-suppress-logging-of-hook-body-in-ptls-create-import-hook/1537

...

  • Interface: create_import_hook(self, name, attrs=None, body=None, overwrite=True, level=logging.INFO)

  • Synopsis: Added a new int parameter 'level' to set a desired log level
    Details:  Default value for level is logging.INFO

  • Interface: import_hook(self, name, body, level=logging.INFO)
    Synopsis: Added a new int parameter 'level' to set a desired log level
    Details: Default value for logbody level is logging.INFO

Hook body will be printed out to the test output by default. Test writers can choose to set 'level' param to 'logging.DEBUG' or logging.DEBUG2 in create_import_hook() and import_hook() methods when dealing with hooks with large body. This will suppress printing of hook body to logs.

...