Changeset 3fdebb8 in code for logger.c


Ignore:
Timestamp:
Mar 6, 2014, 1:56:10 PM (11 years ago)
Author:
Florian Obser <florian@…>
Branches:
master
Children:
f3c60e6
Parents:
709c3bc
git-author:
Florian Obser <florian@…> (03/06/14 13:55:53)
git-committer:
Florian Obser <florian@…> (03/06/14 13:56:10)
Message:

log "Today is...", input mikeb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • logger.c

    r709c3bc r3fdebb8  
    219219logger_tick(void)
    220220{
     221        static int last_mon = -1, last_mday = -1;
    221222        struct timeval tv = { 60, 0 };
    222         static int last_mon = -1;
     223        char buf[128];
    223224        struct tm *tm;
    224225        time_t t;
     
    238239                nlogfiles = 0;
    239240        }
     241        if (tm->tm_mday != last_mday) {
     242                strftime(buf, sizeof(buf),
     243                    "Today is %a %b %e %Y %H:%M %Z (%z)", tm);
     244                for (i = 0; i < nlogfiles; i++)
     245                        fprintf(logfiles[i].fp, "%s\n", buf);
     246                last_mday = tm->tm_mday;
     247        }
    240248        snprintf(line_ts, sizeof line_ts, "%02d:%02d", tm->tm_hour,
    241249            tm->tm_min);
Note: See TracChangeset for help on using the changeset viewer.