How to print the results

Hi,

I have a Gatling script just login into the application and log out.

i want to print or save a successful login user names .

could you suggest me ,how can we approach for that.

.exec(session => {
println(session(“YOURVARIABLENAME OR LOGINNAME”).as[String]) // Gatling 2 API
session
})

Thank you