Changed logging class to allow custom hooks for logging/debugging.