mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
our current experimental Neutrino branch
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@27 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: bc5bd4154e
Author: mrcolor <mrcolor@e54a6e83-5905-42d5-8d5c-058d10e6a962>
Date: 2009-12-08 (Tue, 08 Dec 2009)
This commit is contained in:
41
lib/libdvbsub/Debug.cpp
Normal file
41
lib/libdvbsub/Debug.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
#include "Debug.hpp"
|
||||
|
||||
Debug::Debug() :
|
||||
file_(""), level_(0), fp_(stdout)
|
||||
{
|
||||
}
|
||||
|
||||
Debug::~Debug()
|
||||
{
|
||||
if (fp_ && fp_ != stdout) {
|
||||
fclose(fp_);
|
||||
}
|
||||
}
|
||||
|
||||
void Debug::set_level(int level)
|
||||
{
|
||||
level_ = level;
|
||||
}
|
||||
|
||||
FILE* Debug::set_file(char* file)
|
||||
{
|
||||
FILE* fp = fopen(file, "a");
|
||||
if (!fp) {
|
||||
return NULL;
|
||||
}
|
||||
fp_ = fp;
|
||||
return fp_;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user