|
SASC
DVBSoftCAM
|
00001 #include <stdio.h> 00002 #include "log.h" 00003 extern int tmprintf(const char *plugin, const char *fmt, ...); 00004 static const char *plugin_name; 00005 static unsigned *log_level, print_level, id; 00006 00007 static void LogPrintSasc(const struct LogHeader *lh, const char *txt) { 00008 char tag[80]; 00009 if(print_level <= ((*log_level >> id) & 3)) { 00010 sprintf(tag, "%s(%s)", plugin_name, lh->tag); 00011 tmprintf(tag, "%s\n", txt); 00012 } 00013 } 00014 00015 void SetCAMPrint(const char *_plugin_name, unsigned int plugin_id, unsigned int _print_level, unsigned int *_log_level) { 00016 plugin_name = _plugin_name; 00017 id = plugin_id; 00018 log_level = _log_level; 00019 print_level = _print_level; 00020 cLogging::SetLogPrint(&LogPrintSasc); 00021 }