blob: 659048c052d8fed5c00bbbebfe17fdf4f0538e28 [file] [log] [blame]
#pragma once
#include <util/ffdc_file.hpp>
#include <cstddef> // for size_t
#include <map>
#include <string>
#include <vector>
namespace attn
{
/** @brief Logging level types */
enum level
{
INFO
};
/** @brief Logging event types */
enum class EventType
{
Checkstop = 0,
Terminate = 1,
Vital = 2,
HwDiagsFail = 3,
AttentionFail = 4
};
/** @brief Maximum length of a single trace event message */
static const size_t trace_msg_max_len = 255;
/** @brief create trace message */
template <level L>
void trace(const char* i_message);
/** @brief commit checkstop event to log */
void eventCheckstop(std::map<std::string, std::string>& i_errors);
/** @brief commit special attention TI event to log */
void eventTerminate(std::map<std::string, std::string> i_additionalData);
/** @brief commit SBE vital event to log */
void eventVital();
/** @brief commit analyzer failure event to log */
void eventHwDiagsFail(int i_error);
/** @brief commit attention handler failure event to log */
void eventAttentionFail(int i_error);
/**
* Create an FFDCFile object containing the specified lines of text data.
*
* Throws an exception if an error occurs.
*
* @param lines lines of text data to write to file
* @return FFDCFile object
*/
util::FFDCFile createFFDCFile(const std::vector<std::string>& lines);
/**
* Create FFDCFile objects containing debug data to store in the error log.
*
* If an error occurs, the error is written to the journal but an exception
* is not thrown.
*
* @param journal system journal
* @return vector of FFDCFile objects
*/
std::vector<util::FFDCFile> createFFDCFiles();
} // namespace attn