X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fuglylogging.c;h=a04ab33918face2ada5b05a8ad9796d3aab8e6e8;hb=bf5c470e5912a549e86d3a1f627578c32ff3572e;hp=c6d07f89f08cbe5a2d646960d2eb9c6c271a23b5;hpb=a9237d7eb005642b8938630286c71bb7b17bed6d;p=fw%2Fstlink diff --git a/src/uglylogging.c b/src/uglylogging.c index c6d07f8..a04ab33 100644 --- a/src/uglylogging.c +++ b/src/uglylogging.c @@ -1,7 +1,7 @@ -/* - * UglyLogging. Slow, yet another wheel reinvented, but enough to make the +/* + * UglyLogging. Slow, yet another wheel reinvented, but enough to make the * rest of our code pretty enough. - * + * */ #include @@ -30,29 +30,29 @@ int ugly_log(int level, const char *tag, const char *format, ...) { tt = localtime(&mytt); fprintf(stderr, "%d-%02d-%02dT%02d:%02d:%02d ", tt->tm_year + 1900, tt->tm_mon + 1, tt->tm_mday, tt->tm_hour, tt->tm_min, tt->tm_sec); switch (level) { - case UDEBUG: - fprintf(stderr, "DEBUG %s: ", tag); - break; - case UINFO: - fprintf(stderr, "INFO %s: ", tag); - break; - case UWARN: - fprintf(stderr, "WARN %s: ", tag); - break; - case UERROR: - fprintf(stderr, "ERROR %s: ", tag); - break; - case UFATAL: - fprintf(stderr, "FATAL %s: ", tag); - vfprintf(stderr, format, args); - exit(EXIT_FAILURE); - // NEVER GETS HERE!!! - break; - default: - fprintf(stderr, "%d %s: ", level, tag); - break; + case UDEBUG: + fprintf(stderr, "DEBUG %s: ", tag); + break; + case UINFO: + fprintf(stderr, "INFO %s: ", tag); + break; + case UWARN: + fprintf(stderr, "WARN %s: ", tag); + break; + case UERROR: + fprintf(stderr, "ERROR %s: ", tag); + break; + case UFATAL: + fprintf(stderr, "FATAL %s: ", tag); + vfprintf(stderr, format, args); + exit(EXIT_FAILURE); + // NEVER GETS HERE!!! + break; + default: + fprintf(stderr, "%d %s: ", level, tag); + break; } - vfprintf(stderr, format, args); + vfprintf(stderr, format, args); va_end(args); return 1; -} \ No newline at end of file +}