Changed implementation to have a private inner logger function. Also, changed the implementation of the appender functions to improve sanity checks and prevent some destructive behaviors.