blob: 7f46ce249c23a1c83acc3e811619abd99edeb88b [file] [log] [blame]
/*
// Copyright (c) 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#pragma once
#include <systemd/sd-journal.h>
#include <iostream>
#include <string>
inline void logDeviceAdded(const std::string& device)
{
sd_journal_send("MESSAGE=%s", "Inventory Added", "PRIORITY=%i", LOG_ERR,
"REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.InventoryAdded",
"REDFISH_MESSAGE_ARGS=%s", device.c_str(), NULL);
}
inline void logDeviceRemoved(const std::string& device)
{
sd_journal_send("MESSAGE=%s", "Inventory Removed", "PRIORITY=%i", LOG_ERR,
"REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.InventoryRemoved",
"REDFISH_MESSAGE_ARGS=%s", device.c_str(), NULL);
}