Matthew Barth | b86374d | 2017-04-12 10:57:19 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <phosphor-logging/log.hpp> |
| 4 | |
| 5 | namespace phosphor |
| 6 | { |
| 7 | namespace dbus |
| 8 | { |
| 9 | namespace monitoring |
| 10 | { |
| 11 | namespace action |
| 12 | { |
| 13 | |
| 14 | using namespace phosphor::logging; |
| 15 | |
Matthew Barth | c573643 | 2017-04-17 12:22:50 -0500 | [diff] [blame] | 16 | /** |
| 17 | * @brief An action to log an error with the given message |
| 18 | * |
| 19 | * @param[in] msg - The message to log |
| 20 | * |
| 21 | * @return Lambda function |
| 22 | * A lambda function to perform the log_error function |
| 23 | */ |
Matthew Barth | b86374d | 2017-04-12 10:57:19 -0500 | [diff] [blame] | 24 | inline auto log_error(const char* msg) |
| 25 | { |
| 26 | return [=](auto&, auto&) |
| 27 | { |
| 28 | log<level::ERR>(msg); |
| 29 | }; |
| 30 | } |
| 31 | |
| 32 | } // namespace action |
| 33 | } // namespace monitoring |
| 34 | } // namespace dbus |
| 35 | } // namespace phosphor |