From 5a84cd5e44658b8c4daa47c92b702b7ce8a518f4 Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Thu, 19 Jan 2023 09:57:44 -0500 Subject: [PATCH] Unify debugging setup in sys folder files. --- mentos/src/sys/module.c | 12 +++++------- mentos/src/sys/utsname.c | 7 ++++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mentos/src/sys/module.c b/mentos/src/sys/module.c index 1879610..e871a0f 100644 --- a/mentos/src/sys/module.c +++ b/mentos/src/sys/module.c @@ -3,18 +3,16 @@ /// @copyright (c) 2014-2022 This file is distributed under the MIT License. /// See LICENSE.md for details. -// Include the kernel log levels. -#include "sys/kernel_levels.h" -/// Change the header. -#define __DEBUG_HEADER__ "[MODULE]" -/// Set the log level. -#define __DEBUG_LEVEL__ LOGLEVEL_NOTICE +// Setup the logging for this file (do this before any other include). +#include "sys/kernel_levels.h" // Include kernel log levels. +#define __DEBUG_HEADER__ "[MODULE]" ///< Change header. +#define __DEBUG_LEVEL__ LOGLEVEL_NOTICE ///< Set log level. +#include "io/debug.h" // Include debugging functions. #include "mem/slab.h" #include "sys/module.h" #include "string.h" #include "sys/bitops.h" -#include "io/debug.h" /// Defined in kernel.ld, points at the end of kernel's data segment. extern void *_kernel_end; diff --git a/mentos/src/sys/utsname.c b/mentos/src/sys/utsname.c index 1d123a4..17e6d57 100644 --- a/mentos/src/sys/utsname.c +++ b/mentos/src/sys/utsname.c @@ -3,10 +3,15 @@ /// @copyright (c) 2014-2022 This file is distributed under the MIT License. /// See LICENSE.md for details. +// Setup the logging for this file (do this before any other include). +#include "sys/kernel_levels.h" // Include kernel log levels. +#define __DEBUG_HEADER__ "[UTSNAM]" ///< Change header. +#define __DEBUG_LEVEL__ LOGLEVEL_NOTICE ///< Set log level. +#include "io/debug.h" // Include debugging functions. + #include "string.h" #include "sys/utsname.h" #include "version.h" -#include "io/debug.h" #include "sys/errno.h" #include "fcntl.h" #include "fs/vfs.h"