Rename the logger to log to make is all consistent

Move to `log`


Fixed kmain log
This commit is contained in:
DrDeano 2020-11-13 19:16:25 +00:00
parent ea6a0b7a9f
commit 788bef5029
No known key found for this signature in database
GPG key ID: 96188600582B9ED7
4 changed files with 14 additions and 14 deletions

View file

@ -6,7 +6,7 @@ const build_options = @import("build_options");
const mock_path = build_options.arch_mock_path;
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const logger = std.log.scoped(.pci);
const log = std.log.scoped(.pci);
const arch = if (is_test) @import(mock_path ++ "arch_mock.zig") else @import("arch.zig");
/// The port address for selecting a 32bit register in the PCI configuration space.
@ -301,7 +301,7 @@ pub const PciDeviceInfo = struct {
}
pub fn print(device: arch.Device) void {
logger.info("BUS: 0x{X}, DEV: 0x{X}, FUN: 0x{X}, VID: 0x{X}, DID: 0x{X}, SC: 0x{X}, CC: 0x{X}\n", .{
log.info("BUS: 0x{X}, DEV: 0x{X}, FUN: 0x{X}, VID: 0x{X}, DID: 0x{X}, SC: 0x{X}, CC: 0x{X}\n", .{
device.pci_device.bus,
device.pci_device.device,
device.function,

View file

@ -1,5 +1,5 @@
const std = @import("std");
const logger = std.log.scoped(.kmain);
const kmain_log = std.log.scoped(.kmain);
const builtin = @import("builtin");
const is_test = builtin.is_test;
const build_options = @import("build_options");
@ -79,9 +79,9 @@ export fn kmain(boot_payload: arch.BootPayload) void {
panic_root.panic(@errorReturnTrace(), "Failed to initialise kernel VMM: {}", .{e});
};
logger.info("Init arch " ++ @tagName(builtin.arch) ++ "\n", .{});
kmain_log.info("Init arch " ++ @tagName(builtin.arch) ++ "\n", .{});
arch.init(&mem_profile);
logger.info("Arch init done\n", .{});
kmain_log.info("Arch init done\n", .{});
// The VMM runtime tests can't happen until the architecture has initialised itself
switch (build_options.test_mode) {
@ -137,12 +137,12 @@ export fn kmain(boot_payload: arch.BootPayload) void {
};
// Initialisation is finished, now does other stuff
logger.info("Init\n", .{});
kmain_log.info("Init\n", .{});
// Main initialisation finished so can enable interrupts
arch.enableInterrupts();
logger.info("Creating init2\n", .{});
kmain_log.info("Creating init2\n", .{});
// Create a init2 task
var stage2_task = task.Task.create(@ptrToInt(initStage2), true, kernel_vmm, &kernel_heap.allocator) catch |e| {
@ -185,7 +185,7 @@ fn initStage2() noreturn {
switch (build_options.test_mode) {
.Initialisation => {
logger.info("SUCCESS\n", .{});
kmain_log.info("SUCCESS\n", .{});
},
else => {},
}