mkpy package
Subpackages
Submodules
Module contents
Python utilities for data processing of .crw/.log/.arf files.
This __init__.py file in particular implements some logging facilities that can be used throughout mkpy.
- mkpy.current_function()[source]
Returns the name of the calling function.
- Example:
- def caller():
print(current_function())
>>> caller() 'caller'
- mkpy.log_exceptions(indent_level)[source]
This decorator turns on exception logging for a wrapped function.
Examples
@log_exceptions() def function(): return 0
This will turn on exception logging and the traceback in the log file will be indented with one tab. To specify deeper levels of indentation, use the indent_level parameter:
@log_exceptions(indent_level=2) def function2(): return 0