is it possible to get the name of a sub or function in runtime.

I would like to use this in errorhandling, so i could log the sub-name or functionname to file.