Add log_ssl() and some cleanups

This commit is contained in:
2016-08-09 00:31:49 +03:00
parent 94e0e140b4
commit 5f67602e8e
4 changed files with 22 additions and 26 deletions

View File

@@ -2,14 +2,15 @@
#include <stdio.h>
#include <stdarg.h>
#include <pthread.h>
#include <openssl/err.h>
#include "log_trace.h"
#include "confparser.h"
static FILE *fderr = NULL;
static FILE *fdout = NULL;
static pthread_once_t once = PTHREAD_ONCE_INIT;
static void open_logs(void)
static void open_logs(void)
{
if (conf.rmps.errlog)
fderr = fopen(conf.rmps.errlog, "a");
@@ -17,6 +18,12 @@ static void open_logs(void)
fdout = fopen(conf.rmps.logfile, "a");
}
void log_ssl()
{
ERR_print_errors_fp(fderr);
fflush(fderr);
}
void log_trace(LOG_LEVEL lvl, char *fmt, ... )
{
LOG_LEVEL cur_lvl = conf.rmps.loglevel - '0';