Add: serial logging function w/ errlevels

This commit is contained in:
xamidev
2024-05-22 11:54:59 +02:00
parent 87c1a97d47
commit 61dec7fe14
7 changed files with 26 additions and 3 deletions

View File

@@ -42,3 +42,24 @@ void serial_puts(const char* str)
write_serial(str[i]);
}
}
void log(const char* str, const int errlevel)
{
switch (errlevel)
{
case 0:
serial_puts("[ERROR] ");
break;
case 1:
serial_puts("[WARNING] ");
break;
case 2:
serial_puts("[INFO] ");
break;
case 3:
serial_puts("[DEBUG] ");
break;
}
serial_puts(str);
serial_puts("\n");
}