25
25
#include <drizzled/visibility.h>
30
DRIZZLED_API void unireg_abort(int exit_code) __attribute__((noreturn));
31
void unireg_exit() __attribute__((noreturn));
32
DRIZZLED_API void unireg_actual_abort(const char *file, int line, const char *func, const std::string& message) __attribute__((noreturn));
38
template<class Ch, class Tr, class A>
43
typedef std::basic_ostringstream<Ch, Tr, A> stream_buffer;
46
void operator()(const stream_buffer &s, const char *filename, int line, const char *func)
48
unireg_actual_abort(filename, line, func, s.str());
52
template<template <class Ch, class Tr, class A> class OutputPolicy, class Ch = char, class Tr = std::char_traits<Ch>, class A = std::allocator<Ch> >
55
typedef OutputPolicy<Ch, Tr, A> output_policy;
56
const char *_filename;
67
void set_filename(const char *filename, int line_number, const char *func)
70
_line_number= line_number;
76
output_policy()(arg, _filename, _line_number, _func);
81
log &operator<<(const T &x)
88
typename output_policy::stream_buffer arg;
92
class _unireg : public detail::log<detail::_unireg> {
94
_unireg(const char *filename, int line_number, const char *func)
96
set_filename(filename, line_number, func);
100
} // namespace stream
102
#define unireg_abort stream::_unireg(__FILE__, __LINE__, __func__)
32
104
} /* namespace drizzled */