Shawn McCarney | 7c5d7b2 | 2020-04-03 18:50:13 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2020 IBM Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
| 18 | #include "journal.hpp" |
| 19 | |
| 20 | #include <string> |
| 21 | #include <vector> |
| 22 | |
| 23 | /** |
| 24 | * Extensions to the systemd journal interface. |
| 25 | * |
| 26 | * Provides functions to access and clear mock journal messages that have been |
| 27 | * logged. These functions should only be used by testcases. |
| 28 | */ |
| 29 | namespace phosphor::power::regulators::journal |
| 30 | { |
| 31 | |
| 32 | /** |
| 33 | * Clears all mock journal messages. |
| 34 | */ |
| 35 | void clear(); |
| 36 | |
| 37 | /** |
| 38 | * Returns all mock journal messages with a priority value of 'ERR'. |
| 39 | * |
| 40 | * @return mock error messages |
| 41 | */ |
| 42 | const std::vector<std::string>& getErrMessages(); |
| 43 | |
| 44 | /** |
| 45 | * Returns all mock journal messages with a priority value of 'INFO'. |
| 46 | * |
| 47 | * @return mock informational messages |
| 48 | */ |
| 49 | const std::vector<std::string>& getInfoMessages(); |
| 50 | |
Shawn McCarney | 9af8555 | 2020-04-09 11:43:48 -0500 | [diff] [blame] | 51 | /** |
| 52 | * Returns all mock journal messages with a priority value of 'DEBUG'. |
| 53 | * |
| 54 | * @return mock debug messages |
| 55 | */ |
| 56 | const std::vector<std::string>& getDebugMessages(); |
| 57 | |
Shawn McCarney | 7c5d7b2 | 2020-04-03 18:50:13 -0500 | [diff] [blame] | 58 | } // namespace phosphor::power::regulators::journal |