function log(mode, options, ...args) {
		let location = options.location || "console";
		const $messages = tag("c-message", {
			attr: {
				"log-level": mode,
			},
		});

		args = format(args);

		if (args.length === 1 && args[0] instanceof Error) {
			args.unshift(args[0].message);
		}

		for (let arg of args) {
			const typeofArg = typeof arg;
			arg = arg ?? arg + "";

			let $msg;
			if (mode === "code") {
				$msg = tag("c-code");
				$msg.textContent = arg.length > 50 ? arg.substring(0, 50) + "..." : arg;
				$msg.setAttribute("data-code", arg);
				$msg.setAttribute("action", "use code");
			} else {
				$msg = getElement(typeofArg);

				switch (typeofArg) {
					case "object":
						$msg.append(...getBody(arg));
						break;
					case "function":
						$msg.innerHTML = parseFunction(arg);
						$msg.append(
							tag("c-line", {
								children: getBody(arg),
							}),
						);
						break;
					default:
						$msg.innerHTML = arg;
						break;
				}
			}
			$messages.appendChild($msg);
		}

		if (location) {
			const $stack = tag("c-stack");
			$stack.innerHTML = `<c-date>${new Date().toLocaleString()}</c-date><c-trace>${location}</c-trace>`;
			$messages.appendChild($stack);
		}

		$console.insertBefore($messages, $inputContainer);

		while ($console.childElementCount > 100) {
			$console.firstElementChild.remove();
		}
	}
Prints to the console.
@param {'log'|'error'|'warn'|'code'|'trace'|'table'} mode
@param {{stack: string, location: string}} options
@param  {...any} args