unified logging in javascript