fix check for undefined instead of false value for logger

Fixes #583

Not really sure how to check the output of console.log for this.
`typeof` check should be against a string.

`typeof ctx === 'undefined'`