29 class DefaultStreamBuffer :
public std::stringbuf
37 DefaultStreamBuffer(std::ostream* raw,
const char* type)
46 *raw_ <<
"[" << type_ <<
"] " << str();
53 DefaultStreamBuffer debug_buf(&std::cout,
"DEBUG");
54 DefaultStreamBuffer info_buf(&std::cout,
" INFO");
55 DefaultStreamBuffer warn_buf(&std::cout,
" WARN");
56 DefaultStreamBuffer error_buf(&std::cerr,
"ERROR");
57 DefaultStreamBuffer fatal_buf(&std::cerr,
"FATAL");
59 std::ostream default_debug(&debug_buf);
60 std::ostream default_info(&info_buf);
61 std::ostream default_warn(&warn_buf);
62 std::ostream default_error(&error_buf);
63 std::ostream default_fatal(&fatal_buf);
65 std::ostream* current_debug(&default_debug);
66 std::ostream* current_info(&default_info);
67 std::ostream* current_warn(&default_warn);
68 std::ostream* current_error(&default_error);
69 std::ostream* current_fatal(&default_fatal);
95 return *current_debug;
103 return *current_warn;
107 return *current_error;
111 return *current_fatal;
void setErrorLogger(std::ostream *l)
void setInfoLogger(std::ostream *l)
void setDebugLogger(std::ostream *l)
void setWarnLogger(std::ostream *l)
void setFatalLogger(std::ostream *l)