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