pastebin

Paste #82706: Untitled C paste by 1.202.76.195

#include <stdlib.h>
#include <string.h>
#include <syslog.h>

#define ELOG_INIT(ident, facility) openlog(ident, 0, facility)
#define ELOG_DEBUG(fmt, args...) syslog(LOG_DEBUG, "%s:%d:%s: "fmt, __FILE__, __LINE__, __func__, ##args)

int main(int argc, char *argv[])
{
    char *buf = "test buf";
    char *fmt = "%s";

    ELOG_INIT("logtest", LOG_LOCAL6);

    ELOG_DEBUG("%s", buf); //ok
    ELOG_DEBUG(fmt, buf);  //err

    return 0;
}

Private
Wrap long lines

5 + 4 =