split out the implementation of the log functions

Before, things (ie mutex, queues, etc) that the logging code used
couldn't depend on the implementations of the log functions they use.
10 files changed