25 #ifndef PRESAGE_LOGGER 26 #define PRESAGE_LOGGER 55 template <
class _
charT,
class _Traits=std::
char_traits<_
charT> >
77 std::basic_ostream<_charT,_Traits>& ostr)
80 init(logger_name,
"ERROR");
85 std::basic_ostream<_charT,_Traits>& ostr,
86 const std::string& lvl)
89 init(logger_name, lvl);
93 void init(
const std::string&
name,
const std::string& lvl)
96 state =
new LoggerState();
205 set(
Level& level,
const std::string& lvl)
const 207 if (lvl ==
"EMERG") {
209 }
else if (lvl ==
"FATAL") {
211 }
else if (lvl ==
"ALERT") {
213 }
else if (lvl ==
"CRIT") {
215 }
else if (lvl ==
"ERROR") {
217 }
else if (lvl ==
"WARN") {
219 }
else if (lvl ==
"NOTICE") {
221 }
else if (lvl ==
"INFO") {
223 }
else if (lvl ==
"DEBUG") {
225 }
else if (lvl ==
"ALL") {
236 name =
"[" + logger_name +
"] ";
255 #define define_logger_level_manipulator(LEVEL) \ 256 template <typename _charT, typename _Traits> \ 257 inline const Logger<_charT, _Traits>& \ 258 LEVEL (const Logger<_charT, _Traits>& lgr) \ 260 lgr.setCurrentLevel(Logger<_charT, _Traits>::LEVEL); \ 276 template <
typename _
charT,
typename _Traits>
285 #endif // PRESAGE_LOGGER
Logger(std::string logger_name, std::basic_ostream< _charT, _Traits > &ostr, const std::string &lvl)
Level getCurrentLevel() const
void setCurrentLevel(Level lvl) const
void init(const std::string &name, const std::string &lvl)
friend const Logger & operator<<(const Logger &lgr, const T &msg)
_SetLevel setlevel(std::string __l)
Manipulator for level.
void setLevel(Level lvl) const
void setLevel(const std::string &lvl) const
#define define_logger_level_manipulator(LEVEL)
void set_name(const std::string &logger_name)
Logger(std::string logger_name, std::basic_ostream< _charT, _Traits > &ostr)
std::basic_ostream< _charT, _Traits > & outstream
const Logger< _charT, _Traits > & endl(const Logger< _charT, _Traits > &lgr)