18{
19
20
21
22
23
24
25 py::class_<std::exception>(module, "STDException");
26
27 py::class_<ers::Issue, std::exception>(module, "Issue");
28
29 py::class_<ers::OutputStream>(module, "OutputStream");
30
31
32 py::class_<ers::AnyIssue, ers::Issue>(module, "AnyIssue")
33
34 .def(py::init<const std::string&, const ers::Context&, const std::string&>())
35
36 .def(py::init<const std::string&,
40 const system_clock::time_point&,
41 const std::string&,
42 const std::vector<std::string>&,
43 const std::map<std::string, std::string>&,
53
54
55
56 py::class_<ers::Context>(module, "Context")
71
72
73 py::class_<ers::LocalContext, ers::Context>(module, "LocalContext")
74 .def(py::init<const char*, const char*, int, const char*, bool>());
75
76 py::class_<ers::RemoteProcessContext>(module, "RemoteProcessContext")
77 .def(py::init<const std::string&, int, int, const std::string&, int, const std::string&, const std::string&>());
78
79 py::class_<ers::RemoteContext, ers::Context>(module, "RemoteContext")
80 .def(py::init<const std::string&, const std::string&, int, const std::string&, ers::RemoteProcessContext&>());
81
82
83 py::class_<ers::Severity>(module, "Severity")
84 .def(py::init<ers::severity&, int&>())
87 py::enum_<ers::severity>(module, "severity")
94 .export_values();
95
96
97 module.def("debug", &ers::debug, "sends issue to the debug stream", py::arg("issue"), py::arg("level"));
98 module.def("log", &ers::log, "sends issue to the log stream", py::arg("issue"));
99 module.def("info", &ers::info, "sends issue to the information stream", py::arg("issue"));
100 module.def("warning", &ers::warning, "sends issue to the warning stream", py::arg("issue"));
101 module.def("error", &ers::error, "sends issue to the error stream", py::arg("issue"));
102 module.def("fatal", &ers::fatal, "sends issue to the fatal stream", py::arg("issue"));
103 module.def("debug_level", &ers::debug_level, "returns current debug level for ERS");
104 module.def("verbosity_level", &ers::verbosity_level, "returns current verbosity level for ERS");
105 module.def("enable_core_dump", &ers::enable_core_dump, "does what the name implies");
106}
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