Partially Working Error Log - Still needs work
Refactored code to remove unnecessary static function calls