mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
[Implement #593] Add a RLOG, TLOG helper macro
This commit is contained in:
parent
4916392aa8
commit
4c4cba73c8
@ -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.
|
||||
*
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user