Show
Ignore:
Timestamp:
07/24/08 10:44:45 (4 months ago)
Author:
rbertholon
Message:

correction in logger (log.c file)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/centstorage/src/log.c

    r5649 r5883  
    157157          || !unit && openedTime + (3600 * 24 * ti) < time(NULL)) 
    158158        { 
    159           char  date[32]; 
     159          char  date[32], *tmp; 
    160160          int   i, j, count; 
    161161          char  *arch_log; 
     
    172172                  if (date[j - 1] != UNDERSCORE) 
    173173                    date[j++] = UNDERSCORE; 
     174                  if (conf->logs->unit && count == 3) 
     175                    tmp = &char_time[i] + 1; 
    174176                } 
    175177              else if (count == 1 || count == 2 || count == 4) 
    176178                { 
    177179                  date[j] = char_time[i]; 
     180                  ++j; 
     181                } 
     182            } 
     183          if (conf->logs->unit) 
     184            { 
     185              count = 0; 
     186              date[j++] = '_'; 
     187              for (i = 0; i < 9; ++i) 
     188                { 
     189                  date[j] = tmp[i]; 
     190                  if (date[j] == ':') 
     191                    { 
     192                      if (count == 0) 
     193                        date[j] = 'h'; 
     194                      else if (count == 1) 
     195                        date[j] = 'm'; 
     196                    } 
     197                  else if (date[j] == ' ') 
     198                    date[j] = 's'; 
    178199                  ++j; 
    179200                }