Move getUserAgent to log.js