mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
testing dvb subtitles
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@126 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <sys/timeb.h>
|
||||
#include <time.h>
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
#include "Debug.hpp"
|
||||
@@ -29,13 +31,26 @@ FILE* Debug::set_file(char* file)
|
||||
return fp_;
|
||||
}
|
||||
|
||||
void Debug::print(int /*level*/, const char *fmt, ...)
|
||||
void Debug::print(int level, const char *fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
va_start(argp, fmt);
|
||||
// if (level < level_) {
|
||||
vfprintf(fp_, fmt, argp);
|
||||
// }
|
||||
va_end(argp);
|
||||
struct timeb tp;
|
||||
char buf[1024];
|
||||
char tbuf[20];
|
||||
int len;
|
||||
struct tm tv;
|
||||
|
||||
if (level < level_) {
|
||||
ftime(&tp);
|
||||
localtime_r (&tp.time, &tv);
|
||||
strftime (tbuf, 14, "%H:%M:%S", &tv);
|
||||
len = sprintf(buf, "[ %s.%03d ] ", tbuf, tp.millitm);
|
||||
|
||||
va_start(argp, fmt);
|
||||
//vfprintf(fp_, fmt, argp);
|
||||
vsnprintf (&buf[len], 512, fmt, argp);
|
||||
va_end(argp);
|
||||
fprintf(fp_, "%s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user