mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 16:51:33 -04:00
Log assert
This commit is contained in:
parent
666c32a557
commit
d1fc3f1f5d
@ -8,6 +8,7 @@
|
|||||||
#include "assert.hpp"
|
#include "assert.hpp"
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
#include "kernel.hpp"
|
#include "kernel.hpp"
|
||||||
|
#include "logging.hpp"
|
||||||
|
|
||||||
void __thor_assert(bool condition){
|
void __thor_assert(bool condition){
|
||||||
__thor_assert(condition, "assertion failed");
|
__thor_assert(condition, "assertion failed");
|
||||||
@ -15,12 +16,14 @@ void __thor_assert(bool condition){
|
|||||||
|
|
||||||
void __thor_assert(bool condition, const char* message){
|
void __thor_assert(bool condition, const char* message){
|
||||||
if(!condition){
|
if(!condition){
|
||||||
|
logging::logf(logging::log_level::ERROR, "Assertion failed: %s\n", message);
|
||||||
k_print_line(message);
|
k_print_line(message);
|
||||||
suspend_kernel();
|
suspend_kernel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void __thor_unreachable(const char* message){
|
void __thor_unreachable(const char* message){
|
||||||
|
logging::logf(logging::log_level::ERROR, "Reached unreachable block: %s\n", message);
|
||||||
k_print_line(message);
|
k_print_line(message);
|
||||||
suspend_kernel();
|
suspend_kernel();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user