version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
mspass::utility::LogData Class Reference

Public Member Functions

 LogData (const int jid, const std::string alg, const mspass::utility::MsPASSError &merr)
 
 LogData (const int jid, const std::string alg, const std::string msg, const mspass::utility::ErrorSeverity lvl)
 

Public Attributes

int job_id
 
int p_id
 
std::string algorithm
 
mspass::utility::ErrorSeverity badness
 
std::string message
 

Friends

std::ostream & operator<< (std::ostream &, LogData &)
 

Constructor & Destructor Documentation

◆ LogData() [1/3]

mspass::utility::LogData::LogData ( )
inline
21{};

◆ LogData() [2/3]

mspass::utility::LogData::LogData ( const int  jid,
const std::string  alg,
const mspass::utility::MsPASSError merr 
)

Normal constuctor from a MsPASSError or child of same.

Parameters
jidis the value to assign to job_id.
algis assigned to algorithm attribute.
merris parsed to fill the message and severity fields. Note p_id is always fetched with the system call getpid in the constructor.
8 {
9 job_id = jid;
10 p_id = getpid();
11 algorithm = alg;
12 message = merr.what();
13 badness = merr.severity();
14}
const char * what() const noexcept
Definition MsPASSError.h:100
ErrorSeverity severity() const
Definition MsPASSError.h:102

References mspass::utility::MsPASSError::severity(), and mspass::utility::MsPASSError::what().

◆ LogData() [3/3]

mspass::utility::LogData::LogData ( const int  jid,
const std::string  alg,
const std::string  msg,
const mspass::utility::ErrorSeverity  lvl 
)

Normal constuctor from strings.

Parameters
jidis the value to assign to job_id.
algis assigned to algorithm attribute.
msgis the error message.
lvlis the error severity. Note p_id is always fetched with the system call getpid in the constructor.
16 {
17 job_id = jid;
18 p_id = getpid();
19 algorithm = alg;
20 message = msg;
21 badness = lvl;
22}

The documentation for this class was generated from the following files: