18 {
19
20
21
22
23
24
25
26 py::class_<std::exception>(module, "STDException");
27
28 py::class_<ers::Issue, std::exception>(module, "Issue");
29
30 py::class_<ers::OutputStream>(module, "OutputStream");
31
32
33 py::class_<ers::AnyIssue, ers::Issue>(module, "AnyIssue")
34
36 const std::string &>())
37
38 .def(py::init<const std::string &,
41 const system_clock::time_point &,const std::string &,
42 const std::vector<std::string> &, const std::map<std::string,
52
53
54
55 py::class_<ers::Context>(module, "Context")
70
71
72 py::class_<ers::LocalContext, ers::Context>(module, "LocalContext")
73 .def(py::init<const char *, const char *, int, const char *, bool>());
74
75 py::class_<ers::RemoteProcessContext>(module, "RemoteProcessContext")
76 .def(py::init<const std::string &, int, int, const std::string &, int, const std::string &, const std::string &>());
77
78 py::class_<ers::RemoteContext, ers::Context>(module, "RemoteContext")
79 .def(py::init<const std::string &, const std::string &, int, const std::string &, ers::RemoteProcessContext &>());
80
81
82 py::class_<ers::Severity>(module,"Severity")
83 .def(py::init<ers::severity &, int &>())
86 py::enum_<ers::severity>(module,"severity")
93 .export_values();
94
95
96 module.def("debug", &ers::debug, "sends issue to the debug stream", py::arg("issue"), py::arg("level") );
97 module.def("log", &ers::log, "sends issue to the log stream", py::arg("issue"));
98 module.def("info", &ers::info, "sends issue to the information stream", py::arg("issue"));
99 module.def("warning", &ers::warning, "sends issue to the warning stream", py::arg("issue"));
100 module.def("error", &ers::error, "sends issue to the error stream", py::arg("issue"));
101 module.def("fatal", &ers::fatal, "sends issue to the fatal stream", py::arg("issue"));
102 module.def("debug_level", &ers::debug_level, "returns current debug level for ERS");
103 module.def("verbosity_level", &ers::verbosity_level, "returns current verbosity level for ERS");
104 module.def("enable_core_dump", &ers::enable_core_dump, "does what the name implies");
105}
virtual inheritance_type get_class_inheritance() const final
Get inheritance chain.
virtual void raise() const
throws a copy of this issue preserving the real issue type
virtual const char * get_class_name() const
Get key for class (used for serialisation)
An abstract interface to access an Issue context.
virtual void *const * stack_symbols() const =0
virtual int line_number() const =0
virtual int stack_size() const =0
virtual const char * user_name() const =0
virtual int user_id() const =0
virtual pid_t thread_id() const =0
virtual const char * host_name() const =0
virtual pid_t process_id() const =0
virtual const char * package_name() const =0
virtual const char * application_name() const =0
virtual const char * file_name() const =0
virtual const char * cwd() const =0
virtual const char * function_name() const =0
Base class for any user define issue.
ers::Severity severity() const
severity of the issue
const std::vector< std::string > & qualifiers() const
return array of qualifiers
const string_map & parameters() const
return array of parameters
const char * what() const noexcept
General cause of the issue.
const Issue * cause() const
return the cause Issue of this Issue
std::list< std::string > inheritance_type