blob: 8e2a2554c8c189962d55948be7e28f1df909549a [file] [log] [blame]
Shawn McCarney7c5d7b22020-04-03 18:50:13 -05001/**
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 */
29namespace phosphor::power::regulators::journal
30{
31
32/**
33 * Clears all mock journal messages.
34 */
35void clear();
36
37/**
38 * Returns all mock journal messages with a priority value of 'ERR'.
39 *
40 * @return mock error messages
41 */
42const 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 */
49const std::vector<std::string>& getInfoMessages();
50
51} // namespace phosphor::power::regulators::journal