|
|
@ -36,6 +36,8 @@ namespace srslte{
|
|
|
|
logger_file::logger_file()
|
|
|
|
logger_file::logger_file()
|
|
|
|
:inited(false)
|
|
|
|
:inited(false)
|
|
|
|
,not_done(true)
|
|
|
|
,not_done(true)
|
|
|
|
|
|
|
|
,cur_length(0)
|
|
|
|
|
|
|
|
,max_length(0)
|
|
|
|
{}
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
logger_file::~logger_file() {
|
|
|
|
logger_file::~logger_file() {
|
|
|
@ -48,11 +50,11 @@ logger_file::~logger_file() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void logger_file::init(std::string file, int max_length) {
|
|
|
|
void logger_file::init(std::string file, int max_length_) {
|
|
|
|
pthread_mutex_init(&mutex, NULL);
|
|
|
|
pthread_mutex_init(&mutex, NULL);
|
|
|
|
pthread_cond_init(¬_empty, NULL);
|
|
|
|
pthread_cond_init(¬_empty, NULL);
|
|
|
|
pthread_cond_init(¬_full, NULL);
|
|
|
|
pthread_cond_init(¬_full, NULL);
|
|
|
|
this->max_length = max_length*1024;
|
|
|
|
max_length = max_length_*1024;
|
|
|
|
name_idx = 0;
|
|
|
|
name_idx = 0;
|
|
|
|
filename = file;
|
|
|
|
filename = file;
|
|
|
|
logfile = fopen(filename.c_str(), "w");
|
|
|
|
logfile = fopen(filename.c_str(), "w");
|
|
|
|