Move isValid to log.js