Merge pull request #1 from fourcube/master

Extracted ThreadSafeLogger into separate module.
Header is only written for new files.