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));
33
void unireg_startup_finished();
39
template<class Ch, class Tr, class A>
44
typedef std::basic_ostringstream<Ch, Tr, A> stream_buffer;
47
void operator()(const stream_buffer &s, const char *filename, int line, const char *func)
49
unireg_actual_abort(filename, line, func, s.str());
53
template<template <class Ch, class Tr, class A> class OutputPolicy, class Ch = char, class Tr = std::char_traits<Ch>, class A = std::allocator<Ch> >
56
typedef OutputPolicy<Ch, Tr, A> output_policy;
57
const char *_filename;
68
void set_filename(const char *filename, int line_number, const char *func)
71
_line_number= line_number;
77
output_policy()(arg, _filename, _line_number, _func);
82
log &operator<<(const T &x)
89
typename output_policy::stream_buffer arg;
93
class _unireg : public detail::log<detail::_unireg> {
95
_unireg(const char *filename, int line_number, const char *func)
97
set_filename(filename, line_number, func);
101
} // namespace stream
103
#define unireg_abort stream::_unireg(__FILE__, __LINE__, __func__)
32
105
} /* namespace drizzled */