Replaced stdout/err with advanced, configurable logging