Skip to content

Commit

Permalink
Removed debug log to /dev/console
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanbogushgl committed Nov 22, 2021
1 parent 666b8ee commit 0d6afe5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
18 changes: 9 additions & 9 deletions log.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#include "log.h"

// void log_message(int priority, const char *format, ...)
// {
// va_list vl;
void log_message(int priority, const char *format, ...)
{
va_list vl;

// openlog(NULL, LOG_PERROR, LOG_DAEMON | LOG_PID);
// va_start(vl, format);
// vsyslog(priority, format, vl);
// va_end(vl);
// closelog();
// }
openlog(NULL, LOG_PERROR, LOG_DAEMON | LOG_PID);
va_start(vl, format);
vsyslog(priority, format, vl);
va_end(vl);
closelog();
}
14 changes: 1 addition & 13 deletions log.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@
#define LINFO LOG_INFO
#define LDEBUG LOG_DEBUG


#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

#define log_message(priority, format, ...) \
do { \
FILE *fd = fopen("/dev/console", "w+"); \
fprintf(fd, format, ##__VA_ARGS__); \
fclose(fd); \
} while (0)

//void log_message(int priority, const char *format, ...);
void log_message(int priority, const char *format, ...);

#endif

0 comments on commit 0d6afe5

Please sign in to comment.