Since I have written about my pet project about a month ago, I have made some major changes to the functionality of it.
If you haven't read that blog about my pet project, here's the synopsis:
I love Logger to instrument my code, I just don't like to type in all the bits and pieces to register all the input arguments when I write a new procedure or function. To solve this problem I have written a generator which takes the (packaged) procedure name and generates the body with all the instrumentation code in place. The only thing left to do is focus on the functionality that needs to be implemented in the first place.
First of all the name of the package changed. Now it is called LoggerUtil, which I believe is more inline with the functionality.
But that is only a minor change. The big change is that it is now possible to create your own templates for Procedures and Functions.
The basic mechanism to generate a template is the same as before, see my previous blog for an example or refer to the README.md file on the project page.
In order to use custom templates, you will need to use Logger release 3.0.1, because the supportive procedure to set and get custom preferences. Unfortunately it is not possible to use conditional compilation checking the version of Logger that you have installed.
To create a custom template you can use the procedure called "set_custom_template". This procedure takes two arguments:
- P_TYPE: which kind of template do you want to store; a (F)unction or (P)rocedure.
- P_TEMPLATE: a string containing your custom template
loggerutil.set_custom_template (p_type => 'P' ,p_template => 'your_custom_template' );The custom template is stored in the standard LOGGER_PREFS table with the custom preferences:
There are some placeholders that you can use your custom template:
The name of the procedure or function.
All the arguments are listed (IN, OUT and IN/OUT). Handy for when you want to use this in the comments section. The text (or spaces) before the placeholder is placed before each argument.
Only the IN and IN/OUT arguments are used for calls to Logger.
When you want to reset the custom templates and go back to the original use:
You can find the LoggerUtil project on Github.