Last active
August 29, 2015 14:05
-
-
Save AndreyZarembo/d2c831d6cd89ae76ead4 to your computer and use it in GitHub Desktop.
NSLog analog for C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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