turn log_api call into a macro
nice indentation for special hooks
instant logging of functions that terminate
there is no ret variable when doing instant logging
allow flags variable name to be specified