From: Maxim Mamontov Date: Mon, 31 Aug 2015 18:51:10 +0000 (+0300) Subject: Added logger for rlm_stg. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/872ac0485ae3c7b74d6adb23e64677e835737f8e?ds=inline Added logger for rlm_stg. --- diff --git a/projects/rlm_stg/Makefile b/projects/rlm_stg/Makefile index 72788bcb..c17a740b 100644 --- a/projects/rlm_stg/Makefile +++ b/projects/rlm_stg/Makefile @@ -10,7 +10,8 @@ PROG = $(LIB_NAME).so SRCS = ./rlm_stg.c \ ./iface.cpp \ - ./stg_client.cpp + ./stg_client.cpp \ + ./radlog.c STGLIBS = crypto \ common \ @@ -22,10 +23,12 @@ STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) ifeq ($(OS),linux) -LIBS += -ldl +LIBS += -ldl \ + -lyajl else LIBS += -lintl \ - -lc + -lc \ + -lyajl endif SEARCH_DIRS = -I ../../include diff --git a/projects/rlm_stg/radlog.c b/projects/rlm_stg/radlog.c new file mode 100644 index 00000000..523dc1c4 --- /dev/null +++ b/projects/rlm_stg/radlog.c @@ -0,0 +1,23 @@ +#include "radlog.h" + +//#ifndef NDEBUG +//#define NDEBUG +#include +#include +#include +//#undef NDEBUG +//#endif + +#include + +void RadLog(const char* format, ...) +{ + char buf[1024]; + + va_list vl; + va_start(vl, format); + vsnprintf(buf, sizeof(buf), format, vl); + va_end(vl); + + DEBUG("[rlm_stg] *** %s", buf); +} diff --git a/projects/rlm_stg/radlog.h b/projects/rlm_stg/radlog.h new file mode 100644 index 00000000..00a5dcb5 --- /dev/null +++ b/projects/rlm_stg/radlog.h @@ -0,0 +1,14 @@ +#ifndef __STG_RADLOG_H__ +#define __STG_RADLOG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void RadLog(const char* format, ...); + +#ifdef __cplusplus +} +#endif + +#endif