Device specific test report generation

I am trying to run appium tests on multiple android and iOS devices in parallel.

I am using TestNG as my test runner and I am also generating a report based on it.

Now, I need to know which tests passed and failed for which devices. I need to publish the device name or udid along with the test results. Is there any good and standard way to achieve this?

Can anyone help me out with this?

Get Caps from the driver. It should have the detail you need. Add those details to the logs.