Includes stdio.h in log.h
Fixes perror() calls
Logs PEEKDATA failures