Changeset 5ed701d for launchers/macosx


Ignore:
Timestamp:
Sep 30, 2018 11:34:20 AM (22 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
5041883d
Parents:
410f9df
Message:

Mac OSX Launcher: updates in logging, remove timestamp from Objc's MLog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/I2PLauncher/logger_c.h

    r410f9df r5ed701d  
    4444 */
    4545
    46 void MLog(int loglevel, NSString* format, ...)
     46inline void MLog(int loglevel, NSString* format, ...)
    4747{
    4848#ifdef __cplusplus
    49   static NSDateFormatter* timeStampFormat;
    50   if (!timeStampFormat) {
    51     timeStampFormat = [[NSDateFormatter alloc] init];
    52     [timeStampFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];
    53     [timeStampFormat setTimeZone:[NSTimeZone systemTimeZone]];
    54   }
    55  
    56   NSString* timestamp = [timeStampFormat stringFromDate:[NSDate date]];
    5749 
    5850  va_list vargs;
     
    6153  va_end(vargs);
    6254 
    63   NSString* message = [NSString stringWithFormat:@"<%@> %@", timestamp, formattedMessage];
     55  NSString* message = formattedMessage;
    6456 
    6557  switch (loglevel) {
    6658    case 0:
    67       MLOGF(ANNOYING) << message;
     59      MLOG(ANNOYING) << [message UTF8String];
    6860      break;
    6961    case 1:
    70       MLOGF(DEBUG) << message;
     62      MLOG(DEBUG) << [message UTF8String];
    7163      break;
    7264    case 2:
    73       MLOGF(INFO) << message;
     65      MLOG(INFO) << [message UTF8String];
    7466      break;
    7567    case 3:
    76       MLOGF(WARN) << message;
     68      MLOG(WARN) << [message UTF8String];
    7769      break;
    7870    case 4:
    79       MLOGF(ERROR) << message;
     71      MLOG(ERROR) << [message UTF8String];
    8072      break;
    8173    default:
    8274#if DEBUG
    8375      assert(false);
     76#else
     77      return;
    8478#endif
    8579  }
Note: See TracChangeset for help on using the changeset viewer.