Added logging for both managed and unmanaged code ( Unmanaged code invokes a C# delegate marshaled to a functino pointer ).