Agent can log information

Logs can be outputted to console or to a file
Files are buggy, they're not closed properly.