blob: e5269d1f8af9c5a99d81cc1a3d143295e52afacf [file] [log] [blame]
Matthew Barthb86374d2017-04-12 10:57:19 -05001#pragma once
2
3#include <phosphor-logging/log.hpp>
4
5namespace phosphor
6{
7namespace dbus
8{
9namespace monitoring
10{
11namespace action
12{
13
14using namespace phosphor::logging;
15
Matthew Barthc5736432017-04-17 12:22:50 -050016/**
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 Barthb86374d2017-04-12 10:57:19 -050024inline 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