Javascript logging solution