|
@@ -36,7 +36,7 @@ void logger_print_time(_IO_FILE* stream) {
|
|
|
*/
|
|
|
|
|
|
void logger_error(const char* format, ...) {
|
|
|
- pthread_mutex_lock(&mutex);
|
|
|
+ pthread_mutex_lock(&mutex_logger);
|
|
|
va_list args;
|
|
|
fprintf( stderr, KRED);
|
|
|
if (optDate)
|
|
@@ -47,7 +47,7 @@ void logger_error(const char* format, ...) {
|
|
|
va_end(args);
|
|
|
fprintf( stderr, KNRM);
|
|
|
lastlog = LOG_ERROR;
|
|
|
- pthread_mutex_unlock(&mutex);
|
|
|
+ pthread_mutex_unlock(&mutex_logger);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -70,7 +70,7 @@ void logger(logger_verbose_t verboselevel, logger_type_t logtype,
|
|
|
const char* format, ...) {
|
|
|
if (verbose < verboselevel)
|
|
|
return;
|
|
|
- pthread_mutex_lock(&mutex);
|
|
|
+ pthread_mutex_lock(&mutex_logger);
|
|
|
switch (logtype) {
|
|
|
case LOG_CAN:
|
|
|
printf(KBOLD);
|
|
@@ -101,7 +101,7 @@ void logger(logger_verbose_t verboselevel, logger_type_t logtype,
|
|
|
if (logtype > 0)
|
|
|
printf(KNRM);
|
|
|
lastlog = logtype;
|
|
|
- pthread_mutex_unlock(&mutex);
|
|
|
+ pthread_mutex_unlock(&mutex_logger);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -113,7 +113,7 @@ void logger(logger_verbose_t verboselevel, logger_type_t logtype,
|
|
|
void logger(logger_verbose_t verboselevel, const char* format, ...) {
|
|
|
if (verbose < verboselevel)
|
|
|
return;
|
|
|
- pthread_mutex_lock(&mutex);
|
|
|
+ pthread_mutex_lock(&mutex_logger);
|
|
|
if (optDate)
|
|
|
logger_print_time(stdout);
|
|
|
va_list args;
|
|
@@ -121,5 +121,5 @@ void logger(logger_verbose_t verboselevel, const char* format, ...) {
|
|
|
vprintf(format, args);
|
|
|
va_end(args);
|
|
|
lastlog = 0;
|
|
|
- pthread_mutex_unlock(&mutex);
|
|
|
+ pthread_mutex_unlock(&mutex_logger);
|
|
|
}
|