seperated out cmd's library logging setup/flushing to keep logger.go clean