How to Capture value from console logs and store it to a file in Trueclient protocol

In Trueclient protocol, i am executing JavaScript code with the help of Evaluate JavaScript function. Output of that code we are getting in Console i.e Developer option.

We need to store that output from console logs in a csv file and further download that file.

Can anyone guide me how to print console log output in CSV file?

Thanks in advance!