summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-13 02:27:05 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-13 02:27:05 +0100
commit63b04ffc264aab5313811f1aa7ffc30715814e67 (patch)
treecb6b8bb525bab093bd1484f7a2fd7ffdfa380b8d /lib
parentb126d01e9687e6509c9d49b1b174c95aee603a89 (diff)
cleanup and refactoring. abstracting away console
Diffstat (limited to 'lib')
-rw-r--r--lib/logger/log.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/logger/log.c b/lib/logger/log.c
index 7bc1d82..f2b9834 100644
--- a/lib/logger/log.c
+++ b/lib/logger/log.c
@@ -4,6 +4,7 @@
#include <stdarg.h>
#include "log.h"
+#include "kernel/console.h"
#include "lib/printf/printf.h"
#include "kernel/config.h"
#include "lib/int/stdint.h"
@@ -15,8 +16,6 @@ static char buffer[BUF_SIZE];
static int first;
static int last;
-void PutConsole(char *str, int color);
-
void log(char *module_name, int log_level, char *format_string, ...)
{
#ifdef FOOLOS_LOG_OFF
@@ -41,13 +40,8 @@ void log(char *module_name, int log_level, char *format_string, ...)
tfp_vsprintf(buf_info,format_string,va);
va_end(va);
- PutConsole(buf_time,0b0111101111101111);
- PutConsole(module_name,0b1111100000000000);
- PutConsole(": ",0b0000011111100000);
- PutConsole(buf_info, 0b0111101111111111);
- PutConsoleNL();
-
tfp_sprintf(buf_log,"%s %s: %s\n",buf_time,module_name,buf_info);
+ console_put_str(buf_log);
for(int i=0;buf_log[i]!=0;i++)
{
@@ -60,12 +54,17 @@ void log(char *module_name, int log_level, char *format_string, ...)
}
-void panic(char *module_name, char *format_string)
+void panic(char *module_name, char *message)
{
+ char buf_log[256];
+ /*
PutConsole("!! KERNEL PANIC !! ",0b1111100000000000);
PutConsole(module_name,0b1111100000000000);
PutConsole(" : ",0b0000011111100000);
PutConsole(format_string,0b1111100000000000);
+ */
+ tfp_sprintf(buf_log,"KERNEL PANIC !! %s: %s\n",module_name,message);
+ console_put_str(buf_log);
while(1); // halt
}