logging: add a LoggerDB::internalWarning() function
authorAdam Simpkins <simpkins@fb.com>
Thu, 15 Jun 2017 18:03:52 +0000 (11:03 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 15 Jun 2017 18:06:06 +0000 (11:06 -0700)
commit78307e3ff5e75a490a4059fd72e2c659385cda7b
tree8cf7c0a9eb1afe971376a21f8c58d766bb03d16c
parentdc37f8eab5797e63c7cfe6f02de23518a40dcaa3
logging: add a LoggerDB::internalWarning() function

Summary:
A few places in the logging code need to report issues when something goes
wrong in the logging code itself.  This adds a new LoggerDB::internalWarning()
method for use in these places.

This provides a default implementation that logs these warnings with
_CrtDbgReport() on Windows, and writes to stderr on non-Windows platforms.
The default implementation can also be overridden for programs that want some
alternative behavior.

Reviewed By: wez

Differential Revision: D5157731

fbshipit-source-id: e27f5587d58b3941fca8d5b38c8c3edbcb75d7f3
folly/experimental/logging/LogCategory.cpp
folly/experimental/logging/LoggerDB.cpp
folly/experimental/logging/LoggerDB.h