link.js: Improve JSON logging