63 std::lock_guard<std::mutex> lock(m_mutex);
65 stream_list_type::iterator it;
67 for(it = m_stream.begin(); it != m_stream.end(); ++it)
79 std::lock_guard<std::mutex> lock(m_mutex);
81 m_stream.push_front(s);
91 std::lock_guard<std::mutex> lock(m_mutex);
93 stream_list_type::iterator it
94 = std::find(m_stream.begin(), m_stream.end(), s);
96 if(it != m_stream.end())
108 std::lock_guard<std::mutex> lock(m_mutex);
110 m_stream.push_front(s);
119 std::lock_guard<std::mutex> lock(m_mutex);
130 std::lock_guard<std::mutex> lock(m_mutex);
132 m_log_level = lvl.
get();
140 std::lock_guard<std::mutex> lock(m_mutex);
142 if(m_message_level <= m_log_level)
144 stream_list_type::iterator it;
146 for(it = m_stream.begin(); it != m_stream.end(); ++it)
157 std::lock_guard<std::mutex> lock(m_mutex);
159 m_message_level = that.
get();
161 if(m_message_level <= m_log_level)
181void claw::log_system::print(
const std::string& s)
183 stream_list_type::iterator it;
185 for(it = m_stream.begin(); it != m_stream.end(); ++it)
195 return log << std::endl;
200 (log <<
"\n").flush();
Set the level of the next message for logger_system::operator<<().
int get() const
Get the level value.
std::string get_string() const
Get the prefix.
A class implementing a logging system.
CLAW_LOGGER_EXPORT void remove(const stream_type *s)
Remove a stream.
CLAW_LOGGER_EXPORT void clear()
Delete the streams.
CLAW_LOGGER_EXPORT ~log_system()
Destructor.
CLAW_LOGGER_EXPORT void set_level(int lvl)
Change the level of log.
CLAW_LOGGER_EXPORT void set(stream_type *s)
Set the output stream.
CLAW_LOGGER_EXPORT void flush()
Flush all log streams.
CLAW_LOGGER_EXPORT void merge(stream_type *s)
Add an other output stream.
CLAW_LOGGER_EXPORT log_system()
Default constructor.
Some basic classes for logging.
This is the main namespace.
CLAW_LOGGER_EXPORT log_system & lendl(log_system &log)
Add a new line caracter to a logger and flush it.
CLAW_LOGGER_EXPORT log_system logger
The default log system provided by claw.