added callback support for cb.log() and cb.errorLog(); added error type/message safety