Add a way to customize how logging is done.

Each architecture may have a different method to enable logging. Now
that can be customized with a function passed to the init_logger
function.

Also, provide a minimal x86_64 implementation.

This is the first commit where you can see logging coming from the log
crate.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
This commit is contained in:
Wren Turkal
2020-08-08 02:18:28 -07:00
parent 29a9592e7b
commit dafd2e9f98
2 changed files with 21 additions and 7 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ pub unsafe extern fn kstart(args_ptr: *const KernelArgs) -> ! {
KERNEL_SIZE.store(kernel_size, Ordering::SeqCst);
// Initialize logger
log::init_logger();
log::init_logger(|r| println!("{}:{} -- {}", r.target(), r.level(), r.args()));
info!("Redox OS starting...");
println!("Kernel: {:X}:{:X}", kernel_base, kernel_base + kernel_size);