Go to the documentation of this file.
23 #ifndef SRC_HEADERS_GX_LOGGING_H_
24 #define SRC_HEADERS_GX_LOGGING_H_
26 #include <glib/gi18n.h>
27 #include <glibmm/dispatcher.h>
28 #include <boost/thread/mutex.hpp>
29 #include <boost/format.hpp>
44 typedef sigc::signal<void, const std::string&, MsgType, bool>
msg_signal;
57 std::string
format(
const char* func,
const std::string& msg);
66 void print(
const char* func,
const std::string& msg,
MsgType msgtype);
78 inline void gx_print_error(
const char* fnc,
const boost::basic_format<char>& msg) {
82 inline void gx_print_fatal(
const char* fnc,
const boost::basic_format<char>& msg) {
86 inline void gx_print_info(
const char* fnc,
const boost::basic_format<char>& msg) {
94 virtual const char*
what()
const throw() {
109 sigc::signal<void, bool> exit_sig;
111 sigc::signal<void,std::string> message;
115 void set_ui_thread() { ui_thread = pthread_self(); }
116 sigc::signal<void, bool>& signal_exit() {
return exit_sig; }
117 sigc::signal<void,std::string>& signal_msg() {
return message; }
118 void exit_program(std::string
msg =
"",
int errcode = 1);
119 void fatal_msg(
const std::string&
msg) { message(
msg); exit_program(
msg); }
123 #endif // SRC_HEADERS_GX_LOGGING_H_
void gx_print_fatal(const char *, const std::string &)
void gx_print_info(const char *, const std::string &)
void print(const char *func, const std::string &msg, MsgType msgtype)
GxFatalError(boost::basic_format< char > &m)
std::string format(const char *func, const std::string &msg)
void gx_print_warning(const char *, const std::string &)
static GxLogger & get_logger()
sigc::signal< void, const std::string &, MsgType, bool > msg_signal
friend class GxLoggerGuard
GxFatalError(std::string m)
void gx_print_error(const char *, const std::string &)
std::list< logmsg * > msglist
logmsg(std::string m, MsgType t, bool p)
void gx_print_logmsg(const char *, const std::string &, GxLogger::MsgType)
Glib::Dispatcher * got_new_msg
virtual const char * what() const
msg_signal & signal_message()