function log(...args) {
	// This hackery is required for IE8/9, where
	// the `console.log` function doesn't have 'apply'
	return typeof console === 'object' &&
		console.log &&
		console.log(...args);
}
Encodes a packet with binary data in a base64 string

@param {Object} packet, has `type` and `data`
@return {String} base64 encoded message