DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ers.PyIssue Class Reference
Inheritance diagram for ers.PyIssue:
[legend]
Collaboration diagram for ers.PyIssue:
[legend]

Public Member Functions

 __init__ (self, message, kwargs, cause)
 
 context (self)
 
 parameters (self)
 
 isInstanceOf (self, cname)
 
 __str__ (self)
 
- Public Member Functions inherited from ers::Issue
 Issue (const Context &context, const std::string &message=std::string())
 
 Issue (const Context &context, const std::exception &cause)
 
 Issue (const Context &context, const std::string &message, const std::exception &cause)
 
 Issue (const Issue &other)
 
virtual ~Issue () noexcept
 
virtual Issueclone () const =0
 
virtual const char * get_class_name () const =0
 Get key for class (used for serialisation)
 
virtual inheritance_type get_class_inheritance () const =0
 Get inheritance chain.
 
virtual void raise () const =0
 throws a copy of this issue preserving the real issue type
 
void add_qualifier (const std::string &qualif)
 adds a qualifier to the issue
 
const Issuecause () const
 return the cause Issue of this Issue
 
const Contextcontext () const
 Context of the issue.
 
const std::string & message () const
 General cause of the issue.
 
const std::vector< std::string > & qualifiers () const
 return array of qualifiers
 
const string_mapparameters () const
 return array of parameters
 
ers::Severity severity () const
 severity of the issue
 
template<class Precision = std::chrono::seconds>
std::string time (const std::string &format="%Y-%b-%d %H:%M:%S", bool isUTC=false) const
 string representation of local time of the issue
 
template<class Precision >
std::string localtime (const std::string &format="%Y-%b-%d %H:%M:%S") const
 string representation of UTC time of the issue
 
template<class Precision >
std::string gmtime (const std::string &format="%Y-%b-%d %H:%M:%S") const
 
std::time_t time_t () const
 seconds since 1 Jan 1970
 
const system_clock::time_point & ptime () const
 original time point of the issue
 
const char * what () const noexcept
 General cause of the issue.
 
ers::Severity set_severity (ers::Severity severity) const
 
void wrap_message (const std::string &begin, const std::string &end)
 

Public Attributes

 time = time.time()
 
 message = message
 
 cause = cause
 
 context_parameters = vars(self.__context)
 
list qualifiers = [ self.__context.package_name ]
 
 rpc
 
 rc = ers.RemoteContext(self.__context.package_name,self.__context.file_name,self.__context.line_number,self.__context.function_name,self.rpc)
 
 ai = ers.AnyIssue( self.__context.function_name, self.rc, message )
 

Private Attributes

 __context = PyContext(self)
 
 __parameters = dict([ (str(k), str(v)) for (k,v) in list(kwargs.items()) ])
 

Static Private Attributes

 __verbosity = int( os.getenv( "DUNEDAQ_ERS_VERBOSITY_LEVEL", "2" ) )
 

Additional Inherited Members

- Protected Member Functions inherited from ers::Issue
 Issue (Severity severity, const system_clock::time_point &time, const ers::Context &context, const std::string &message, const std::vector< std::string > &qualifiers, const std::map< std::string, std::string > &parameters, const ers::Issue *cause=0)
 Gets a value of any type that has an input operator for the standard stream defined.
 
template<typename T >
void get_value (const std::string &key, T &value) const
 
void get_value (const std::string &key, const char *&value) const
 
void get_value (const std::string &key, std::string &value) const
 Sets a value of any type that has an output operator for the standard stream defined.
 
template<typename T >
void set_value (const std::string &key, T value)
 
void set_message (const std::string &message)
 
void prepend_message (const std::string &message)
 
- Static Protected Member Functions inherited from ers::Issue
static auto _get_inheritance ()
 

Detailed Description

Definition at line 47 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

ers.PyIssue.__init__ ( self,
message,
kwargs,
cause )

Definition at line 51 of file __init__.py.

51 def __init__( self, message, kwargs, cause ):
52 Exception.__init__( self, message, kwargs, cause )
53 self.time = time.time()
54# self.severity = ers.severity.Error
55 self.message = message
56 self.cause = cause
57 self.__context = PyContext(self)
58 self.context_parameters = vars(self.__context)
59 self.qualifiers = [ self.__context.package_name ]
60 self.__parameters = dict([ (str(k), str(v)) for (k,v) in list(kwargs.items()) ])
61 self.__dict__.update( kwargs )
62 self.rpc = ers.RemoteProcessContext(self.__context.host_name,self.__context.process_id,self.__context.thread_id,
63 self.__context.cwd,self.__context.user_id,self.__context.user_name,
64 self.__context.application_name)
65 self.rc = ers.RemoteContext(self.__context.package_name,self.__context.file_name,self.__context.line_number,self.__context.function_name,self.rpc)
66 #self.lc = ers.LocalContext(self.__context.application_name, self.__context.file_name, self.__context.line_number, self.__context.function_name, False)
67 self.ai = ers.AnyIssue( self.__context.function_name, self.rc, message )
68

Member Function Documentation

◆ __str__()

ers.PyIssue.__str__ ( self)

Definition at line 80 of file __init__.py.

80 def __str__( self ):
81 return self.message
82
83'''Wrap a message string as an ERS issue'''

◆ context()

ers.PyIssue.context ( self)

Definition at line 70 of file __init__.py.

70 def context( self ):
71 return self.__context
72

◆ isInstanceOf()

ers.PyIssue.isInstanceOf ( self,
cname )

Definition at line 77 of file __init__.py.

77 def isInstanceOf( self, cname ):
78 return self.__class__.__name__ == cname and True or False
79

◆ parameters()

ers.PyIssue.parameters ( self)

Definition at line 74 of file __init__.py.

74 def parameters( self ):
75 return self.__parameters
76

Member Data Documentation

◆ __context

ers.PyIssue.__context = PyContext(self)
private

Definition at line 57 of file __init__.py.

◆ __parameters

ers.PyIssue.__parameters = dict([ (str(k), str(v)) for (k,v) in list(kwargs.items()) ])
private

Definition at line 60 of file __init__.py.

◆ __verbosity

ers.PyIssue.__verbosity = int( os.getenv( "DUNEDAQ_ERS_VERBOSITY_LEVEL", "2" ) )
staticprivate

Definition at line 49 of file __init__.py.

◆ ai

ers.PyIssue.ai = ers.AnyIssue( self.__context.function_name, self.rc, message )

Definition at line 67 of file __init__.py.

◆ cause

ers.PyIssue.cause = cause

Definition at line 56 of file __init__.py.

◆ context_parameters

ers.PyIssue.context_parameters = vars(self.__context)

Definition at line 58 of file __init__.py.

◆ message

ers.PyIssue.message = message

Definition at line 55 of file __init__.py.

◆ qualifiers

list ers.PyIssue.qualifiers = [ self.__context.package_name ]

Definition at line 59 of file __init__.py.

◆ rc

ers.PyIssue.rc = ers.RemoteContext(self.__context.package_name,self.__context.file_name,self.__context.line_number,self.__context.function_name,self.rpc)

Definition at line 65 of file __init__.py.

◆ rpc

ers.PyIssue.rpc
Initial value:
= ers.RemoteProcessContext(self.__context.host_name,self.__context.process_id,self.__context.thread_id,
self.__context.cwd,self.__context.user_id,self.__context.user_name,
self.__context.application_name)

Definition at line 62 of file __init__.py.

◆ time

ers.PyIssue.time = time.time()

Definition at line 53 of file __init__.py.


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