Merge pull request #837 from theopolis/rlog

[Implement #593] Add a RLOG, TLOG helper macro
This commit is contained in:
Teddy Reed 2015-03-10 16:06:30 -07:00
commit 116d93ef0c
2 changed files with 20 additions and 1 deletions

View File

@ -48,6 +48,25 @@ struct StatusLogLine {
std::string message; std::string message;
}; };
/**
* @brief Helper logging macro for table-generated verbose log lines.
*
* Since logging in tables does not always mean a critical warning or error
* but more likely a parsing or expected edge-case, we provide a TLOG.
*
* The tool user can set within config or via the CLI what level of logging
* to tolerate. It's the table developer's job to assume consistency in logging.
*/
#define TLOG VLOG(1)
/**
* @brief Prepend a reference number to the log line.
*
* A reference number is an external-search helper for somewhat confusing or
* seeminly-critical log lines.
*/
#define RLOG(n) "[Ref #" #n "] "
/** /**
* @brief Superclass for the pluggable logging facilities. * @brief Superclass for the pluggable logging facilities.
* *

View File

@ -56,7 +56,7 @@ void IOKitHIDEventPublisher::restart() {
auto status = IOHIDManagerOpen(manager_, kIOHIDOptionsTypeNone); auto status = IOHIDManagerOpen(manager_, kIOHIDOptionsTypeNone);
if (status != kIOReturnSuccess) { if (status != kIOReturnSuccess) {
LOG(WARNING) << "[Reference #617] Cannot open IOKit HID Manager"; LOG(WARNING) << RLOG(617) << "Cannot open IOKit HID Manager";
return; return;
} }