Skip to content

Instantly share code, notes, and snippets.

@zulonas
Last active September 21, 2021 11:08
Show Gist options
  • Save zulonas/19681eb4e4029b216f0494e551c478a7 to your computer and use it in GitHub Desktop.
Save zulonas/19681eb4e4029b216f0494e551c478a7 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <syslog.h>
#define LOG(FORMAT, ...) {\
openlog(NULL, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);\
syslog(LOG_INFO, "%s:%d " FORMAT "\n", __BASE_FILE__, __LINE__, ##__VA_ARGS__);\
closelog();\
}
int main()
{
LOG("asd");
LOG("%s", "zxc");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment