There are compile time constants for at least two of those.
"<$entname>" will produce the entity name.
"<$triggerabbr>" will produce the trigger abbreviation.
"<$fieldname>" will produce the field name.
Alternatively, you can look at the $proccontext("STACK"), which shows the entire call stack as a list of lists.
Depending where you look at this (inside your global routine (Global proc?) then the point which called it is the second or third entry in the list.
We have a global proc for logging which basically decodes the entire stack to save the point in the program at which the error occurs, and how it got there.
You need to look at the values in there for different points in the program (component triggers/operations/lpms, entity triggers/operations/lpms and field triggers/operations/lpms.
The $proccontext has the advantage of being coded once in the error routine, rather than in the call.
Iain