You can just use a select statement ie
Code:
select "starting proc xxx"
This can be improved by adding a time at the front so you can see if anything is taking too long to execute. The disadvantage of having just plain select statements is that you'll need to comment them out when the code goes live and, if you suddenly find you need this info again, you'll need to uncomment everything to see the logging. The other disadvantage is that your users will see the logging also.
Logging can be improved by adding a where clause with a global flag so you can turn debugging on or off at any time. Another improvement is to insert the log info into a log table rather than to the screen so you can read it at any time.
You could also finish things off nicely by writing a stored procedure to do the logging for you and then have different levels of logging (info, log, warning or error) so only certain messages are stored depending on your global flag.
Code:
call db_log_action( in_user_id, 'log', "Re-aligned ids in database" );