Added generic Logln and Logf functions and simplified everything.