Skip to content

Commit a218bc7

Browse files
fixes #126 @1h
1 parent 9444363 commit a218bc7

File tree

7 files changed

+9
-18
lines changed

7 files changed

+9
-18
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
2.3.0
2+
- Remove commented out code (#126)
23
- make logger::logger rule zero compliant (#123)
34
- write more logger::sink tests (#124)
45
- fixed a bug in ./tests/CMakeLists.txt that prevented exception_tests to be run (#121)

include/logger/facilities.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ namespace logger {
6565
// intentional...
6666
}
6767

68-
// virtual ~facility() ;
69-
7068
private:
7169
const facility_code _code;
7270
const char *_keyword;

include/logger/registry.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ namespace logger {
147147
template<class T, typename... Args> logger_ptr get( const std::string &name, const Args&... args){
148148
std::lock_guard<std::mutex> lck(_mutex);
149149

150-
// printf("DEBUG logger::registry.get(%s, %d);\n", name.c_str(), _level);
150+
# ifdef DEBUG
151+
printf("DEBUG logger::registry.get(%s, %d);\n", name.c_str(), _level);
152+
# endif
151153

152154
logger_ptr logger;
153155
auto search = _loggers.find(name);
@@ -178,7 +180,6 @@ namespace logger {
178180
};
179181

180182
~registry() = default;
181-
// ~registry() { std::cout << "DEBUG delete registry..." << std::endl ; };
182183

183184
private:
184185

include/logger/sinks.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ namespace logger {
170170
*/
171171
explicit file_sink(FILE *file);
172172

173-
// virtual ~file_sink() ;
174-
175173
/** \copydoc sink::write()
176174
*
177175
* This sink writes messages in FILE.
@@ -293,7 +291,7 @@ namespace logger {
293291
*/
294292
explicit syslog_sink();
295293

296-
~syslog_sink() = default ; //override ;
294+
~syslog_sink() = default ;
297295

298296
/** \copydoc sink::write
299297
*

src/file_sink.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ namespace logger {
5050
_lag = buffer;
5151
};
5252

53-
// TODO remove this
54-
// file_sink::~file_sink() {
55-
// //fflush(_file_descriptor);
56-
// };
57-
5853
void file_sink::set_name(const std::string &name) {
5954
sink::set_name(name);
6055

@@ -85,7 +80,7 @@ namespace logger {
8580

8681
// new character vector
8782
// vsnprintf returns the needed characters to store the output
88-
// not possible with XL C/C++ std::vector<char> buf(1+std::vsnprintf(NULL, 0, fmt, args1));
83+
//NOSONAR not possible with XL C/C++ std::vector<char> buf(1+std::vsnprintf(NULL, 0, fmt, args1));
8984

9085
// this call only returns the actual number of bytes needed to store the message.
9186
// It doesn't count the needed end-of-string

src/registry.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ namespace logger {
9999

100100
registry::registry() noexcept : _level(log_levels::info), _pname("program") {
101101
// intentional...
102-
//std::cout << "DEBUG Create regsistry instance..." << std::endl;
102+
# ifdef DEBUG
103+
std::cout << "DEBUG Create regsistry instance..." << std::endl;
104+
# endif
103105
}
104106

105107
} // namespace logger

src/syslog_sink.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ namespace logger {
5959
// intentional
6060
}
6161

62-
// syslog_sink::~syslog_sink() {
63-
// // intentional
64-
// };
65-
6662
void syslog_sink::write(log_level level, const char *fmt, ...) {
6763
#ifdef DEBUG
6864
printf("DEBUG %s _level/level: %d/%d, pattern: [%s] (%s,%d)\n", __FUNCTION__, _level, level, _pattern.c_str(), __FILE__,__LINE__);

0 commit comments

Comments
 (0)