summaryrefslogtreecommitdiff
path: root/lib/logger/log.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-24 23:30:12 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-24 23:30:12 +0200
commit8ea3e244d44190e44a092ffb004e13ad94174c68 (patch)
tree2365b0ec35b4fbdc82d49bcefc014fc8af59b251 /lib/logger/log.c
parent1b64f1e69bfbffc0e70ba3a1baff00ed3fd8cb51 (diff)
porting ncurses...
Diffstat (limited to 'lib/logger/log.c')
-rw-r--r--lib/logger/log.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/logger/log.c b/lib/logger/log.c
index ef68a2e..e95f089 100644
--- a/lib/logger/log.c
+++ b/lib/logger/log.c
@@ -10,13 +10,14 @@
#include "kernel/timer.h"
#include "kernel/fifo.h"
+#include "lib/string/string.h"
+
static char buffer[LOG_BUF_SIZE];
static int first=0;
static int last=0;
static bool init=true;//
-
static void log_string(char *str)
{
while(*str!=0)
@@ -26,14 +27,21 @@ static void log_string(char *str)
}
}
+static char* whitelist[]={FOOLOS_LOG_WHITELIST};
+
void log(char *module_name, int log_level, char *format_string, ...)
{
#ifdef FOOLOS_LOG_OFF
- return;
+ for(int i=0;i<3;i++)
+ {
+
+ if(!strcmp(module_name,whitelist[i]))break;
+ if(!strcmp("",whitelist[i]))return;
+ }
#endif
- if(log_level<FOOLOS_LOG_INFO)return;
+ if(log_level<FOOLOS_LOG_LEVEL)return;
char buf_info[256];
char buf_log[256];