log: break after printing the log message
This commit is contained in:
parent
e321b9eee7
commit
dd00f4167a
12
log.cpp
12
log.cpp
@ -195,14 +195,8 @@ level_width (void)
|
|||||||
void
|
void
|
||||||
util::log (util::level_t level, const std::string &msg)
|
util::log (util::level_t level, const std::string &msg)
|
||||||
{
|
{
|
||||||
// fire a breakpoint before the following early exit
|
|
||||||
if (needs_break (level))
|
|
||||||
breakpoint ();
|
|
||||||
|
|
||||||
static const util::level_t LOG_LEVEL = log_level ();
|
static const util::level_t LOG_LEVEL = log_level ();
|
||||||
if (level > LOG_LEVEL)
|
if (level <= LOG_LEVEL) {
|
||||||
return;
|
|
||||||
|
|
||||||
static const size_t time_len = strlen("YYYY-mm-dd HHMMhSS") + 1;
|
static const size_t time_len = strlen("YYYY-mm-dd HHMMhSS") + 1;
|
||||||
std::string time_string (time_len - 1, '\0');
|
std::string time_string (time_len - 1, '\0');
|
||||||
time_t unix_time = time (nullptr);
|
time_t unix_time = time (nullptr);
|
||||||
@ -225,6 +219,10 @@ util::log (util::level_t level, const std::string &msg)
|
|||||||
<< "] " << msg << std::endl;
|
<< "] " << msg << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (needs_break (level))
|
||||||
|
breakpoint ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
util::scoped_logger::scoped_logger (util::level_t _level,
|
util::scoped_logger::scoped_logger (util::level_t _level,
|
||||||
|
Loading…
Reference in New Issue
Block a user