javascript: add snippet for log