moved logError into proper library (IMHO)