4 releases

0.1.3 Mar 8, 2024
0.1.2 Oct 16, 2022
0.1.1 Jan 19, 2022
0.1.0 Jan 19, 2022

#307 in Hardware support

23 downloads per month

Custom license


Rust crates.io docs.rs


A minimalistic logger for Windows Kernel Drivers.



use kernel_log::KernelLogger;

pub extern "system" fn DriverEntry(_: PDRIVER_OBJECT, _: u64) -> NTSTATUS {
    KernelLogger::init(LevelFilter::Info).expect("Failed to initialize logger");

    log::warn!("This is an example message.")


Implements the print!, println! and dbg! macros so they can be used in the kernel without the use of an allocator.

By default the macros are prefixed with kernel_. If you want to remove the prefix, you can enable the std_name feature.


Exactly as you'd use the original macros from the standard library.


// ...

kernel_dbg!(2 + 2);
kernel_print!("{} + {} = {}\n", 2, 2, 2 + 2);
kernel_println!("{} + {} = {}", 2, 2, 2 + 2);


  • std_name: Allows you to use the macros without the kernel_ prefix.
  • format: Uses the format! macro instead of the core::fmt::Write trait to convert the passed data into a string. This crate provides a simple wrapper for logging with the DbgPrint function. The logs won't be included in the final binary which helps to harden reverse engineering.


~24K SLoC