AC_SUBST(LIBSPEEX_CFLAGS)
AC_SUBST(LIBSPEEX_LIBS)
+#### dlog support ####
+AC_ARG_ENABLE(dlog, AC_HELP_STRING([--enable-dlog], [using dlog]),
+[
+ case "${enableval}" in
+ yes) USE_DLOG=yes ;;
+ no) USE_DLOG=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-dlog) ;;
+ esac
+ ],[USE_DLOG=no])
+
+if test "x$USE_DLOG" = "xyes"; then
+ PKG_CHECK_MODULES(DLOG, dlog)
+ AC_SUBST(DLOG_CFLAGS)
+ AC_SUBST(DLOG_LIBS)
+fi
+AM_CONDITIONAL(USE_DLOG, test "x$USE_DLOG" = "xyes")
+
#### Xen support (optional) ####
AC_ARG_ENABLE([xen],
AS_IF([test "x$HAVE_ADRIAN_EC" = "x1"], ENABLE_ADRIAN_EC=yes, ENABLE_ADRIAN_EC=no)
AS_IF([test "x$HAVE_SPEEX" = "x1"], ENABLE_SPEEX=yes, ENABLE_SPEEX=no)
AS_IF([test "x$HAVE_WEBRTC" = "x1"], ENABLE_WEBRTC=yes, ENABLE_WEBRTC=no)
+AS_IF([test "x$HAVE_DLOG" = "xyes"], ENABLE_DLOG=yes, ENABLE_DLOG=no)
AS_IF([test "x$HAVE_TDB" = "x1"], ENABLE_TDB=yes, ENABLE_TDB=no)
AS_IF([test "x$HAVE_GDBM" = "x1"], ENABLE_GDBM=yes, ENABLE_GDBM=no)
AS_IF([test "x$HAVE_SIMPLEDB" = "x1"], ENABLE_SIMPLEDB=yes, ENABLE_SIMPLEDB=no)
Enable Adrian echo canceller: ${ENABLE_ADRIAN_EC}
Enable speex (resampler, AEC): ${ENABLE_SPEEX}
Enable WebRTC echo canceller: ${ENABLE_WEBRTC}
+ Enable DLOG: ${ENABLE_DLOG}
Database
tdb: ${ENABLE_TDB}
gdbm: ${ENABLE_GDBM}
#include "log.h"
+#ifdef USE_DLOG
+#include <dlog.h>
+#define DLOG_TAG "PULSEAUDIO"
+
+#define COLOR_BLACK 30
+#define COLOR_RED 31
+#define COLOR_GREEN 32
+#define COLOR_BLUE 34
+#define COLOR_MAGENTA 35
+#define COLOR_CYAN 36
+#define COLOR_WHITE 97
+#define COLOR_B_GRAY 100
+#define COLOR_B_RED 101
+#define COLOR_B_GREEN 102
+#define COLOR_B_YELLOW 103
+#define COLOR_B_BLUE 104
+#define COLOR_B_MAGENTA 105
+#define COLOR_B_CYAN 106
+#define COLOR_REVERSE 7
+
+#endif
+
#define ENV_LOG_SYSLOG "PULSE_LOG_SYSLOG"
#define ENV_LOG_LEVEL "PULSE_LOG"
#define ENV_LOG_COLORS "PULSE_LOG_COLORS"
break;
}
+#ifdef USE_DLOG
+ case PA_LOG_DLOG: {
+ char *local_t;
+
+ openlog(ident, LOG_PID, LOG_USER);
+
+ if ((local_t = pa_utf8_to_locale(t)))
+ t = local_t;
+
+ switch (level)
+ {
+ case PA_LOG_DEBUG:
+ SLOG (LOG_DEBUG, DLOG_TAG, "%s%s%s%s", timestamp, location, t, pa_strempty(bt));
+ break;
+ case PA_LOG_INFO:
+ case PA_LOG_NOTICE: // no notice category in dlog, use info instead.
+ SLOG (LOG_INFO, DLOG_TAG, "%s%s%s%s", timestamp, location, t, pa_strempty(bt));
+ break;
+ case PA_LOG_WARN:
+ SLOG (LOG_WARN, DLOG_TAG, "%s%s%s%s", timestamp, location, t, pa_strempty(bt));
+ break;
+ case PA_LOG_ERROR:
+ SLOG (LOG_ERROR, DLOG_TAG, "%s%s%s%s", timestamp, location, t, pa_strempty(bt));
+ break;
+ default:
+ SLOG (LOG_DEBUG, DLOG_TAG, "%s%s%s%s", timestamp, location, t, pa_strempty(bt));
+ break;
+ }
+
+ pa_xfree(local_t);
+
+ break;
+ }
+ case PA_LOG_DLOG_COLOR: {
+ char *local_t;
+
+ openlog(ident, LOG_PID, LOG_USER);
+
+ if ((local_t = pa_utf8_to_locale(t)))
+ t = local_t;
+
+ switch (level)
+ {
+ case PA_LOG_DEBUG:
+ SLOG (LOG_DEBUG, DLOG_TAG, "\033[%dm%s%s%s%s\033[0m", COLOR_GREEN, timestamp, location, t, pa_strempty(bt));
+ break;
+ case PA_LOG_INFO:
+ case PA_LOG_NOTICE: // no notice category in dlog, use info instead.
+ SLOG (LOG_INFO, DLOG_TAG, "\033[%dm%s%s%s%s\033[0m", COLOR_BLUE, timestamp, location, t, pa_strempty(bt));
+ break;
+ case PA_LOG_WARN:
+ SLOG (LOG_WARN, DLOG_TAG, "\033[%dm%s%s%s%s\033[0m", COLOR_MAGENTA, timestamp, location, t, pa_strempty(bt));
+ break;
+ case PA_LOG_ERROR:
+ SLOG (LOG_ERROR, DLOG_TAG, "\033[%dm%s%s%s%s\033[0m", COLOR_RED, timestamp, location, t, pa_strempty(bt));
+ break;
+ default:
+ SLOG (LOG_DEBUG, DLOG_TAG, "%s%s%s%s", timestamp, location, t, pa_strempty(bt));
+ break;
+ }
+
+ pa_xfree(local_t);
+
+ break;
+ }
+
+#endif
case PA_LOG_NULL:
default:
break;