Writing (logging) Atom pymkr standard console output to a file

I was compiling my python code and running on pycom lopy4 devices but wanted to log the messages received at the device to a file instead of displaying it on pymkr standard output console. Is there a way to redirect standard output to a file?