When constructed, logs a message (at "warn" severity); the destructor is guaranteed to be trivial.
This is useful for declaring an instance of this class as a function-static global, so that a warning is logged the first time the program encounters some code, but does not repeat the warning on subsequent encounters within the same process.
For example:
double* SanityCheck(double* data) {
if (!data) {
static const logging::Warn log_once("Bad data!");
return alternative_data();
}
return data;
}
#include <drake/common/text_logging.h>
Public Member Functions | |
| template<typename... Args> | |
| Warn (const char *a, const Args &... b) | |
| Warn | ( | const char * | a, |
| const Args &... | b ) |