A flexible JavaScript event logger