Skip to content

Instantly share code, notes, and snippets.

@liuyix
Last active December 20, 2015 17:59
Show Gist options
  • Select an option

  • Save liuyix/6172274 to your computer and use it in GitHub Desktop.

Select an option

Save liuyix/6172274 to your computer and use it in GitHub Desktop.
#define LOGE(fmt,args...) fprintf(stderr, fmt, ##args)
#define LOGD(fmt,args...) fprintf(stderr, fmt, ##args)
#define LOGW(fmt,args...) fprintf(stderr, fmt, ##args)
#include <errno.h>
#include <string.h>
#define PLOGE(fmt,args...) LOGE(fmt " failed with %d: %s", ##args, errno, strerror(errno))
#define PLOGEV(fmt,err,args...) LOGE(fmt " failed with %d: %s", ##args, err, strerror(err))
#include <stdio.h>
#include "c_native_log.h"
int main(int argc, char *argv[]) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment