version  0.0.1
Defines the C++ API for MsPASS
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/2]

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.
10 {
11  job_id=jid;
12  p_id=getpid();
13  algorithm=alg;
14  message=merr.what();
15  badness=merr.severity();
16 }
ErrorSeverity severity() const
Definition: MsPASSError.h:109
const char * what() const noexcept
Definition: MsPASSError.h:107

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

◆ LogData() [2/2]

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.
18 {
19  job_id=jid;
20  p_id=getpid();
21  algorithm=alg;
22  message=msg;
23  badness=lvl;
24 }

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