rename logdb() function  to logError()