// Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: MIT

use core::panic::*;

use crate::format;
use crate::{LOGGER, LogLevel};

#[panic_handler]
pub fn panic(info: &PanicInfo) -> ! {
    log_critical!("Panic in {}: {}", info.location().unwrap(), info.message());
    // TODO: If any userspace facilities are still working, *attempt* to flush panic info and
    // logs to disk or whatever else. Then kill all processes and reboot.
    loop {
        crate::arch::asm::nop();
    }
}
