-
Notifications
You must be signed in to change notification settings - Fork 2
/
output_stream.cpp
34 lines (26 loc) · 1020 Bytes
/
output_stream.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* SPDX-License-Identifier: MIT */
#include "output_stream.h"
#include "log_event.h"
#include "output_stream_private.h"
#include <iostream>
SuS::logfile::output_stream::output_stream() : m_d{new output_stream_private} {
m_d->m_minLogLevel = SuS::logfile::logger::log_level::SuS_LOG_MINLEVEL;
} // output_stream::constructor
SuS::logfile::output_stream::~output_stream() {
} // output_stream::destructor
void SuS::logfile::output_stream::dump(std::ostream &_stream) {
_stream << " - " << name() << std::endl
<< " min. log level: "
<< SuS::logfile::logger::level_name(m_d->m_minLogLevel) << std::endl;
}
unsigned SuS::logfile::output_stream::retry_time() {
return 30;
} // output_stream::retry_time
void SuS::logfile::output_stream::set_min_log_level(logger::log_level _level) {
m_d->m_minLogLevel = _level;
}
bool SuS::logfile::output_stream::write(const log_event &_le) {
if (_le.level < m_d->m_minLogLevel)
return true /* no error */;
return do_write(_le);
}