blob: f053c66933bfa3cc9ee3f3e066da34f1174701e6 [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 <string>
19
20/**
21 * Systemd journal interface.
22 *
23 * Provides functions to log informational and error messages to the journal.
24 *
25 * This interface provides an abstraction layer so that testcases can use a mock
26 * implementation and validate the logged messages.
27 *
28 * This interface does not currently provide the ability to specify key/value
29 * pairs to provide more information in the journal entry. It will be added
30 * later if needed.
31 */
32namespace phosphor::power::regulators::journal
33{
34
35/**
36 * Logs a message with a priority value of 'ERR' to the systemd journal.
37 *
38 * @param message message to log
39 */
40void logErr(const std::string& message);
41
42/**
43 * Logs a message with a priority value of 'INFO' to the systemd journal.
44 *
45 * @param message message to log
46 */
47void logInfo(const std::string& message);
48
49} // namespace phosphor::power::regulators::journal