Update log.js

Implemented clear log levels and added error events