Commit 297d72d1 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Fix GlogFormatterTest on Windows

Summary:
It was missing a portability header needed for `setenv`, and was assuming that the `system_clock` was represented as nanoseconds.
On Windows `std::chrono::system_clock` is represented as 100s of nanoseconds, ie. `FILETIME`.

Reviewed By: simpkins

Differential Revision: D5308182

fbshipit-source-id: facb922ebe1587723358b38499dadac683e3517b
parent 59e47de8
......@@ -21,6 +21,7 @@
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/init/Init.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Stdlib.h>
using namespace folly;
......@@ -47,7 +48,8 @@ std::string formatMsg(
GlogStyleFormatter formatter;
std::chrono::system_clock::time_point logTimePoint{
std::chrono::nanoseconds{timestampNS}};
std::chrono::duration_cast<std::chrono::system_clock::duration>(
std::chrono::nanoseconds{timestampNS})};
LogMessage logMessage{
category, level, logTimePoint, filename, lineNumber, msg.str()};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment