[Implement #593] Add a RLOG, TLOG helper macro

This commit is contained in:
Teddy Reed 2015-03-08 15:20:36 -07:00
parent 4916392aa8
commit 4c4cba73c8
2 changed files with 20 additions and 1 deletions

View File

@ -47,6 +47,25 @@ struct StatusLogLine {
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.
*

View File

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