custom thread pool, log level checks

check for debug enabled before formatting messages