function debug(namespace, color = selectColor(namespace)) {
	const ns = kl.ansi256(color)(`  ${namespace}  `);
	return (...args) => {
		if (hasDebugFlag()) {
			const str = args.map(arg => {
				const value = arg === null || typeof arg !== 'object' ? arg : util.inspect(arg, false, null, true);

				return value
					.split('\n')
					.map(line => ns + line)
					.join('\n');
			});
			// eslint-disable-next-line no-console
			console.log.apply(console, str);
		}
	};
}
Print namespaced log messages when the DEBUG environment
variable is set.
@param {string} namespace
@param {number} [color]
@returns {(...args: any[]) => void}