Don't try to use _CrtDbgReport in the logging framework
authorChristopher Dykes <cdykes@fb.com>
Thu, 15 Jun 2017 23:54:38 +0000 (16:54 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 16 Jun 2017 00:05:33 +0000 (17:05 -0700)
Summary: Glog doesn't try to, so there's no real reason to try and be smart. Just do the same thing as every other platform for now until we have reason to do otherwise.

Reviewed By: simpkins

Differential Revision: D5259435

fbshipit-source-id: dcdf55f51f2e13945afd351cb45e9c1a22f56218

folly/experimental/logging/LoggerDB.cpp

index 4886fb9a65598a3a36c334fb567a6651c05c50fe..0d6434513413401928ee41460c80c28e4a61ae3a 100644 (file)
  */
 #include <folly/experimental/logging/LoggerDB.h>
 
  */
 #include <folly/experimental/logging/LoggerDB.h>
 
-#if _WIN32
-#include <crtdbg.h>
-#endif
-
 #include <folly/Conv.h>
 #include <folly/FileUtil.h>
 #include <folly/String.h>
 #include <folly/Conv.h>
 #include <folly/FileUtil.h>
 #include <folly/String.h>
@@ -275,11 +271,6 @@ void LoggerDB::defaultInternalWarningImpl(
     return;
   }
 
     return;
   }
 
-#if _WIN32
-  // Use _CrtDbgReport() to report the error
-  _CrtDbgReport(
-      _CRT_WARN, filename, lineNumber, "folly::logging", "%s", msg.c_str());
-#else
   if (folly::kIsDebug) {
     // Write directly to file descriptor 2.
     //
   if (folly::kIsDebug) {
     // Write directly to file descriptor 2.
     //
@@ -299,6 +290,5 @@ void LoggerDB::defaultInternalWarningImpl(
         "logging warning:", filename, ":", lineNumber, ": ", msg, "\n");
     folly::writeFull(STDERR_FILENO, fullMsg.data(), fullMsg.size());
   }
         "logging warning:", filename, ":", lineNumber, ": ", msg, "\n");
     folly::writeFull(STDERR_FILENO, fullMsg.data(), fullMsg.size());
   }
-#endif
 }
 }
 }
 }