1c1283ae8SBrad Bishop /**
2c1283ae8SBrad Bishop  * Copyright © 2017 IBM Corporation
3c1283ae8SBrad Bishop  *
4c1283ae8SBrad Bishop  * Licensed under the Apache License, Version 2.0 (the "License");
5c1283ae8SBrad Bishop  * you may not use this file except in compliance with the License.
6c1283ae8SBrad Bishop  * You may obtain a copy of the License at
7c1283ae8SBrad Bishop  *
8c1283ae8SBrad Bishop  *     http://www.apache.org/licenses/LICENSE-2.0
9c1283ae8SBrad Bishop  *
10c1283ae8SBrad Bishop  * Unless required by applicable law or agreed to in writing, software
11c1283ae8SBrad Bishop  * distributed under the License is distributed on an "AS IS" BASIS,
12c1283ae8SBrad Bishop  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c1283ae8SBrad Bishop  * See the License for the specific language governing permissions and
14c1283ae8SBrad Bishop  * limitations under the License.
15c1283ae8SBrad Bishop  */
16c1283ae8SBrad Bishop #include "journal.hpp"
17c1283ae8SBrad Bishop 
18c1283ae8SBrad Bishop namespace phosphor
19c1283ae8SBrad Bishop {
20c1283ae8SBrad Bishop namespace dbus
21c1283ae8SBrad Bishop {
22c1283ae8SBrad Bishop namespace monitoring
23c1283ae8SBrad Bishop {
24c1283ae8SBrad Bishop 
operator ()(Context)25*5e6b51d7SGeorge Liu void JournalBase::operator()(Context /* ctx */)
26c1283ae8SBrad Bishop {
27c1283ae8SBrad Bishop     for (const auto& n : index)
28c1283ae8SBrad Bishop     {
291abcb06bSMatt Spinler         const auto& path = std::get<pathIndex>(n.first);
301abcb06bSMatt Spinler         const auto& pathMeta = std::get<pathMetaIndex>(n.second);
311abcb06bSMatt Spinler         const auto& propertyMeta = std::get<propertyMetaIndex>(n.second);
321abcb06bSMatt Spinler         const auto& storage = std::get<storageIndex>(n.second);
331abcb06bSMatt Spinler         const auto& value = std::get<valueIndex>(storage.get());
34c1283ae8SBrad Bishop 
3526dc0bcbSPatrick Williams         if (value.has_value())
36c1283ae8SBrad Bishop         {
37d1eac88dSBrad Bishop             log(message, pathMeta, path, propertyMeta, value);
38c1283ae8SBrad Bishop         }
39c1283ae8SBrad Bishop     }
40c1283ae8SBrad Bishop }
41c1283ae8SBrad Bishop } // namespace monitoring
42c1283ae8SBrad Bishop } // namespace dbus
43c1283ae8SBrad Bishop } // namespace phosphor
44