Skip to content

Commit

Permalink
Display millisecond in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueMatthew committed Dec 7, 2020
1 parent b9e900f commit cd99832
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions WechatExporter/LoggerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@ class LoggerImpl : public Logger

void write(const std::string& log)
{
time_t rawtime;
struct tm * timeinfo;
char buffer[16] = {0};

std::time(&rawtime);
timeinfo = std::localtime(&rawtime);
std::string timeString = getCurrentTimestamp() + ": ";

strftime (buffer, 16, "%H:%M:%S ", timeinfo);

__block NSString *logString = [NSString stringWithUTF8String:(buffer + log).c_str()];
__block NSString *logString = [NSString stringWithUTF8String:(timeString + log).c_str()];
__block __weak ViewController* viewController = m_viewController;
dispatch_async(dispatch_get_main_queue(), ^{
__strong __typeof(viewController)strongVC = viewController;
Expand Down

0 comments on commit cd99832

Please sign in to comment.