blob: f07ab1a358c06e313315a2acc98b01a1a6d6d66e [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 *
Shawn McCarney9af85552020-04-09 11:43:48 -050023 * Provides functions to log messages to the systemd journal.
Shawn McCarney7c5d7b22020-04-03 18:50:13 -050024 *
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
Shawn McCarney9af85552020-04-09 11:43:48 -050049/**
50 * Logs a message with a priority value of 'DEBUG' to the systemd journal.
51 *
52 * @param message message to log
53 */
54void logDebug(const std::string& message);
55
Shawn McCarney7c5d7b22020-04-03 18:50:13 -050056} // namespace phosphor::power::regulators::journal