Added basic error logging functions