Skip to content

Instantly share code, notes, and snippets.

@AndreyZarembo
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreyZarembo/d2c831d6cd89ae76ead4 to your computer and use it in GitHub Desktop.
Save AndreyZarembo/d2c831d6cd89ae76ead4 to your computer and use it in GitHub Desktop.
NSLog analog for C
// Also include this
// #include <stdio.h>
// #include <time.h>
// #include <string.h>
#define VSLog(fmt, ...) {\
time_t timer;\
time(&timer);\
char *timestamp = ctime(&timer);\
timestamp[strlen(timestamp)-2] = '\0';\
printf("%s: %s " fmt "\n", timestamp, __PRETTY_FUNCTION__,##__VA_ARGS__);\
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment