added optional logging to cmdBuffer