NNFS
Neural network library from scratch
Loading...
Searching...
No Matches
clue.hpp
Go to the documentation of this file.
1// Copyright 2014, 2021 by Martin Moene
2//
3// clue is based on ideas by Mark Nelson, see article at
4// http://www.drdobbs.com/cpp/blundering-into-the-one-definition-rule/240166489
5//
6// Distributed under the Boost Software License, Version 1.0. (See accompanying
7// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8
9#ifndef CLUE_CLUE_H_INCLUDED
10#define CLUE_CLUE_H_INCLUDED
11
12#define clue_MAJOR 1
13#define clue_MINOR 0
14#define clue_PATCH 0
15
16#define clue_VERSION clue_STRINGIFY(clue_MAJOR) "." clue_STRINGIFY(clue_MINOR) "." clue_STRINGIFY(clue_PATCH)
17
18#define clue_STRINGIFY(x) clue_STRINGIFY_(x)
19#define clue_STRINGIFY_(x) #x
20
21#include <iomanip>
22#include <sstream>
23#include <cassert>
24
25#if defined(_MSC_VER)
26#define clue_COMPILER_IS_MSVC
27#if (_MSC_VER >= 1200) && (_MSC_VER < 1300)
28#define clue_COMPILER_IS_MSVC6
29#endif
30#endif
31
32#ifdef clue_COMPILER_IS_MSVC
33#pragma warning(push)
34#pragma warning(disable : 4996) // _CRT_SECURE_NO_WARNINGS
35#endif
36
37#ifndef clue_NO_SHORT_NAMES
38
39#ifdef LOG_MODULE_NAME
40#define clue_LOG_MODULE_NAME LOG_MODULE_NAME
41#endif
42
43#ifdef LOG_LEVEL
44#define clue_LOG_LEVEL LOG_LEVEL
45#endif
46
47#ifdef LOG_LEVEL_BUILD
48#define clue_LOG_LEVEL_BUILD LOG_LEVEL_BUILD
49#endif
50
51#ifdef LOG_TO_CONSOLE
52#define clue_LOG_TO_CONSOLE LOG_TO_CONSOLE
53#endif
54
55#ifdef LOG_TO_FILE
56#define clue_LOG_TO_FILE LOG_TO_FILE
57#endif
58
59#ifdef LOG_TO_DEBUGGER
60#define clue_LOG_TO_DEBUGGER LOG_TO_DEBUGGER
61#endif
62
63#ifdef LOG_TO_DEBUGGER_WINDOWS
64#define clue_LOG_TO_DEBUGGER_WINDOWS LOG_TO_DEBUGGER_WINDOWS
65#endif
66
67#ifdef LOG_TO_EVENTLOG
68#define clue_LOG_TO_EVENTLOG LOG_TO_EVENTLOG
69#endif
70
71#ifdef LOG_TO_STRING
72#define clue_LOG_TO_STRING LOG_TO_STRING
73#endif
74
75#ifdef LOG_TO_SYSLOG
76#define clue_LOG_TO_SYSLOG LOG_TO_SYSLOG
77#endif
78
79#ifdef LOG_EXPRESSION
80#define clue_LOG_EXPRESSION LOG_EXPRESSIONLOG_TO_SYSLOG
81#endif
82
83#endif // clue_NO_SHORT_NAMES
84
85// now we can determine if we must guess a destination:
86
87#ifndef clue_OMIT_UNUSED_LOG_EXPRESSION
88#define clue_OMIT_UNUSED_LOG_EXPRESSION 0
89#endif
90
91#if !defined(clue_LOG_TO_CONSOLE) && \
92 !defined(clue_LOG_TO_FILE) && \
93 !defined(clue_LOG_TO_STRING) && \
94 !defined(clue_LOG_TO_DEBUGGER) && \
95 !defined(clue_LOG_TO_EVENTLOG) && \
96 !defined(clue_LOG_TO_SYSLOG)
97#if defined(_WINDOWS)
98#define clue_LOG_TO_DEBUGGER
99#elif defined(NTS_TO_BE_DETERMINED_UNIX)
100#define clue_LOG_TO_SYSLOG
101#else
102#define clue_LOG_TO_CONSOLE
103#endif
104#endif
105
106#if defined(clue_LOG_TO_CONSOLE) + \
107 defined(clue_LOG_TO_FILE) + \
108 defined(clue_LOG_TO_STRING) + \
109 defined(clue_LOG_TO_DEBUGGER) + \
110 defined(clue_LOG_TO_EVENTLOG) + \
111 defined(clue_LOG_TO_SYSLOG) > \
112 1
113#error Please specify one, or none of [clue_]LOG_TO_CONSOLE, [clue_]LOG_TO_FILE, [clue_]LOG_TO_STRING, [clue_]LOG_TO_DEBUGGER [clue_]LOG_TO_EVENTLOG and [clue_]LOG_TO_SYSLOG
114#endif
115
116// NTS: add UNIX
117#ifdef clue_LOG_TO_DEBUGGER
118#define clue_LOG_TO_DEBUGGER_WINDOWS
119#endif
120
121#ifndef clue_NO_SHORT_NAMES
122
123#define LOG_SEV_NONE clue_LOG_SEV_NONE
124#define LOG_SEV_EMERGENCY clue_LOG_SEV_EMERGENCY
125#define LOG_SEV_ALERT clue_LOG_SEV_ALERT
126#define LOG_SEV_CRITICAL clue_LOG_SEV_CRITICAL
127#define LOG_SEV_ERROR clue_LOG_SEV_ERROR
128#define LOG_SEV_WARNING clue_LOG_SEV_WARNING
129#define LOG_SEV_NOTICE clue_LOG_SEV_NOTICE
130#define LOG_SEV_INFO clue_LOG_SEV_INFO
131#define LOG_SEV_DEBUG clue_LOG_SEV_DEBUG
132#define LOG_SEV_MAX clue_LOG_SEV_MAX
133
134#ifndef clue_LOG_TO_SYSLOG
135#define LOG_EMERGENCY clue_LOG_EMERGENCY
136#define LOG_ALERT clue_LOG_ALERT
137#define LOG_CRITICAL clue_LOG_CRITICAL
138#define LOG_ERROR clue_LOG_ERROR
139#define LOG_WARNING clue_LOG_WARNING
140#define LOG_NOTICE clue_LOG_NOTICE
141#define LOG_INFO clue_LOG_INFO
142#define LOG_DEBUG clue_LOG_DEBUG
143#endif
144
145#define LOG_LOGGED_SEVERITIES clue_LOG_LOGGED_SEVERITIES
146#define LOG_EXPRESSION clue_LOG_EXPRESSION
147
148#endif // clue_NO_SHORT_NAMES
149
150#ifdef clue_LOG_TO_CONSOLE
151#include <iostream>
152#endif
153
154#ifdef clue_LOG_TO_FILE
155#include <fstream>
156#endif
157
158#ifdef clue_LOG_TO_DEBUGGER_WINDOWS
159#include <windows.h>
160#endif
161
162#ifdef clue_LOG_TO_DEBUGGER_UNIX
163#error log to debugger under Unix not implemented
164#endif
165
166#ifdef clue_LOG_TO_EVENTLOG
167#include <windows.h>
168#endif
169
170#ifdef clue_LOG_TO_SYSLOG
171#include <syslog.h>
172#endif
173
174#define clue_LOG_SEV_NONE -1
175#define clue_LOG_SEV_EMERGENCY 0
176#define clue_LOG_SEV_ALERT 1
177#define clue_LOG_SEV_CRITICAL 2
178#define clue_LOG_SEV_ERROR 3
179#define clue_LOG_SEV_WARNING 4
180#define clue_LOG_SEV_NOTICE 5
181#define clue_LOG_SEV_INFO 6
182#define clue_LOG_SEV_DEBUG 7
183#define clue_LOG_SEV_MAX 7
184
185#ifndef clue_LOG_LEVEL
186#define clue_LOG_LEVEL clue_LOG_SEV_DEBUG
187#endif
188
189#ifndef clue_LOG_LEVEL_BUILD
190#define clue_LOG_LEVEL_BUILD clue_LOG_SEV_DEBUG
191#endif
192
193#define clue_LOG_SEV_NONE_TEXT "[clue]"
194#define clue_LOG_SEV_EMERGENCY_TEXT "Emergency"
195#define clue_LOG_SEV_ALERT_TEXT "Alert"
196#define clue_LOG_SEV_CRITICAL_TEXT "Critical"
197#define clue_LOG_SEV_ERROR_TEXT "Error"
198#define clue_LOG_SEV_WARNING_TEXT "Warning"
199#define clue_LOG_SEV_NOTICE_TEXT "Notice"
200#define clue_LOG_SEV_INFO_TEXT "Info"
201#define clue_LOG_SEV_DEBUG_TEXT "Debug"
202
203#ifndef clue_LOG_MODULE_NAME
204#define clue_LOG_MODULE_NAME ""
205#endif
206
207#ifndef clue_LOG_PREFIX_WIDTH
208#define clue_LOG_PREFIX_WIDTH sizeof(clue_LOG_SEV_EMERGENCY_TEXT)
209#endif
210
211#define clue_is_active(severity) \
212 clue::is_true(severity <= clue_LOG_LEVEL)
213
214#define clue_is_active_build(severity) \
215 clue::is_true(clue_IS_ACTIVE_BUILD(severity))
216
217#define clue_IS_ACTIVE_BUILD(severity) \
218 (severity <= clue_LOG_LEVEL_BUILD)
219
220#define clue_LOG_LOGGED_SEVERITIES() \
221 clue_LOG_EXPRESSION(clue_LOG_SEV_NONE, clue::to_severities_text(clue_LOG_LEVEL_BUILD))
222
223#define clue_LOG_NO_EXPRESSION() \
224 do \
225 { \
226 } while (clue::is_true(false))
227
228#define clue_IS_ACTIVE(severity) \
229 (clue_IS_ACTIVE_BUILD(severity) || !clue_OMIT_UNUSED_LOG_EXPRESSION)
230
231#if clue_IS_ACTIVE(clue_LOG_SEV_EMERGENCY)
232#define clue_LOG_EMERGENCY(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_EMERGENCY, expr)
233#else
234#define clue_LOG_EMERGENCY(expr) clue_LOG_NO_EXPRESSION()
235#endif
236
237#if clue_IS_ACTIVE(clue_LOG_SEV_ALERT)
238#define clue_LOG_ALERT(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_ALERT, expr)
239#else
240#define clue_LOG_ALERT(expr) clue_LOG_NO_EXPRESSION()
241#endif
242
243#if clue_IS_ACTIVE(clue_LOG_SEV_CRITICAL)
244#define clue_LOG_CRITICAL(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_CRITICAL, expr)
245#else
246#define clue_LOG_CRITICAL(expr) clue_LOG_NO_EXPRESSION()
247#endif
248
249#if clue_IS_ACTIVE(clue_LOG_SEV_ERROR)
250#define clue_LOG_ERROR(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_ERROR, expr)
251#else
252#define clue_LOG_ERROR(expr) clue_LOG_NO_EXPRESSION()
253#endif
254
255#if clue_IS_ACTIVE(clue_LOG_SEV_WARNING)
256#define clue_LOG_WARNING(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_WARNING, expr)
257#else
258#define clue_LOG_WARNING(expr) clue_LOG_NO_EXPRESSION()
259#endif
260
261#if clue_IS_ACTIVE(clue_LOG_SEV_NOTICE)
262#define clue_LOG_NOTICE(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_NOTICE, expr)
263#else
264#define clue_LOG_NOTICE(expr) clue_LOG_NO_EXPRESSION()
265#endif
266
267#if clue_IS_ACTIVE(clue_LOG_SEV_INFO)
268#define clue_LOG_INFO(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_INFO, expr)
269#else
270#define clue_LOG_INFO(expr) clue_LOG_NO_EXPRESSION()
271#endif
272
273#if clue_IS_ACTIVE(clue_LOG_SEV_DEBUG) && !defined(NDEBUG)
274#define clue_LOG_DEBUG(expr) clue_LOG_EXPRESSION(clue_LOG_SEV_DEBUG, expr)
275#else
276#define clue_LOG_DEBUG(expr) clue_LOG_NO_EXPRESSION()
277#endif
278
279#if defined(clue_LOG_TO_CONSOLE) && !defined(clue_LOG_EXPRESSION)
280#define clue_LOG_EXPRESSION(severity, expr) \
281 do \
282 { \
283 if (clue_is_active_build(severity)) \
284 { \
285 if (clue_is_active(severity)) \
286 { \
287 std::clog << clue::now_text() << std::setw(clue_LOG_PREFIX_WIDTH) << clue::to_severity_text(severity) << clue::to_module_text(clue_LOG_MODULE_NAME) << ": " << expr << "\n"; \
288 } \
289 } \
290 } while (clue::is_true(false))
291#endif
292
293#if defined(clue_LOG_TO_FILE) && !defined(clue_LOG_EXPRESSION)
294#define clue_LOG_EXPRESSION(severity, expr) \
295 do \
296 { \
297 if (clue_is_active_build(severity)) \
298 { \
299 if (clue_is_active(severity)) \
300 { \
301 clue::filelog() << clue::now_text() << std::setw(clue_LOG_PREFIX_WIDTH) << clue::to_severity_text(severity) << clue::to_module_text(clue_LOG_MODULE_NAME) << ": " << expr << "\n"; \
302 } \
303 } \
304 } while (clue::is_true(false))
305#endif
306
307#if defined(clue_LOG_TO_STRING) && !defined(clue_LOG_EXPRESSION)
308#define clue_LOG_EXPRESSION(sev, expr) \
309 clue_LOG_STRING_EXPRESSION(the_log(), sev, expr)
310#endif
311
312#if defined(clue_LOG_TO_STRING) && !defined(clue_LOG_STRING_EXPRESSION)
313#define clue_LOG_STRING_EXPRESSION(log, sev, expr) \
314 do \
315 { \
316 if (clue_is_active_build(sev)) \
317 { \
318 if (clue_is_active(sev)) \
319 { \
320 log.severity(sev); \
321 log << clue_LOG_MODULE_NAME << expr; \
322 } \
323 } \
324 } while (clue::is_true(false))
325#endif
326
327#if defined(clue_LOG_TO_DEBUGGER_WINDOWS) && !defined(clue_LOG_EXPRESSION)
328#define clue_LOG_EXPRESSION(severity, expr) \
329 do \
330 { \
331 if (clue_is_active_build(severity)) \
332 { \
333 if (clue_is_active(severity)) \
334 { \
335 clue::windbg() << std::setw(clue_LOG_PREFIX_WIDTH) << clue::to_severity_text(severity) << clue::to_module_text(clue_LOG_MODULE_NAME) << ": " << expr; \
336 } \
337 } \
338 } while (clue::is_true(false))
339#endif
340
341#if defined(clue_LOG_TO_EVENTLOG) && !defined(clue_LOG_EXPRESSION)
342#define clue_LOG_EXPRESSION(severity, expr) \
343 do \
344 { \
345 if (clue_is_active_build(severity)) \
346 { \
347 if (clue_is_active(severity)) \
348 { \
349 clue::evtlog(severity, clue_LOG_MODULE_NAME) << clue::text_with_or("", clue_LOG_MODULE_NAME, ": ", "") << expr; \
350 } \
351 } \
352 } while (clue::is_true(false))
353#endif
354
355#if defined(clue_LOG_TO_SYSLOG) && !defined(clue_LOG_EXPRESSION)
356#define clue_LOG_EXPRESSION(severity, expr) \
357 do \
358 { \
359 if (clue_is_active_build(severity)) \
360 { \
361 if (clue_is_active(severity)) \
362 { \
363 clue::syslog(severity) << clue_LOG_MODULE_NAME << ": " << expr; \
364 } \
365 } \
366 } while (clue::is_true(false))
367#endif
368
369namespace clue
370{
371
372 inline bool is_true(bool const on) { return on; }
373
374 inline std::string text_or(std::string const &text, std::string const &or_text)
375 {
376 return text.length() ? text : or_text;
377 }
378
379 inline std::string text_with_or(std::string const &prefix, std::string const &text, std::string const &postfix, std::string const &or_text)
380 {
381 return text.length() ? prefix + text + postfix : or_text;
382 }
383
384 inline std::string to_module_text(std::string const &module)
385 {
386 return text_with_or(": ", module, "", "");
387 }
388
389 inline std::string to_severity_text(int const severity)
390 {
391 assert(clue_LOG_SEV_NONE <= severity && severity <= clue_LOG_SEV_MAX && "invalid severity");
392
393 if (severity == clue_LOG_SEV_NONE)
395
396 assert(clue_LOG_SEV_EMERGENCY == 0 && "required by lookup table");
397
398 std::string const cont[] =
399 {
408 };
409 return cont[severity];
410 }
411
412 inline std::string to_severities_text(int const level, std::string const &postfix = ".", std::string const &result = "")
413 {
414 if (level < 0)
415 return result + postfix;
416
417 return to_severities_text(level - 1, postfix, to_severity_text(level) + text_with_or(", ", result, "", ""));
418 }
419
420} // namespace clue
421
422#ifdef clue_NO_TIMESTAMP
423
424namespace clue
425{
426 inline std::string now_text() { return ""; }
427}
428
429#else // clue_NO_TIMESTAMP
430
431#include <ctime>
432
433#ifdef clue_COMPILER_IS_MSVC6
434namespace std
435{
436 using ::localtime;
437 using ::strftime;
438 using ::time;
439 using ::time_t;
440}
441#endif
442
443namespace clue
444{
445
446 inline std::string now_text()
447 {
448 char mbstr[100];
449 const std::time_t now = std::time(NULL);
450
451 // ISO ISO 8601 date and time format: C++11: %FT%T
452 if (std::strftime(mbstr, 100, "%Y-%m-%dT%H:%M:%S", std::localtime(&now)))
453 return mbstr;
454 else
455 return "[time]";
456 }
457} // namespace clue
458
459#endif // clue_NO_TIMESTAMP
460
461#ifdef clue_LOG_TO_FILE
462
463namespace clue
464{
465
466 class filelog
467 {
468 public:
469 filelog()
470 : stream() {}
471
472 ~filelog()
473 {
474 // emit: program-name[pid]:
475 std::ofstream os(clue_LOG_TO_FILE, std::ios_base::app);
476 os << stream.str();
477 }
478
479 template <typename T>
480 filelog &operator<<(T const &that)
481 {
482 stream << that;
483 return *this;
484 }
485
486 private:
487 std::ostringstream stream;
488 };
489
490} // namespace clue
491
492#endif // clue_LOG_TO_FILE
493
494#ifdef clue_LOG_TO_STRING
495
496namespace clue
497{
498
499 class strlog
500 {
501 public:
502 strlog()
503 : severity_(clue_LOG_SEV_NONE), stream() {}
504
505 void clear()
506 {
507 severity_ = clue_LOG_SEV_NONE;
508 stream.str(std::string());
509 }
510
511 void severity(int const sev)
512 {
513 severity_ = sev;
514 }
515
516 int severity() const
517 {
518 return severity_;
519 }
520
521 std::string text() const
522 {
523 return stream.str();
524 }
525
526 template <typename T>
527 strlog &operator<<(T const &that)
528 {
529 stream << that;
530 return *this;
531 }
532
533 private:
534 int severity_;
535 std::ostringstream stream;
536 };
537
538 inline strlog &the_log()
539 {
540 static strlog log;
541 return log;
542 }
543
544} // namespace clue
545
546#endif // clue_LOG_TO_STRING
547
548#ifdef clue_LOG_TO_DEBUGGER_WINDOWS
549
550namespace clue
551{
552
553 class windbg
554 {
555 public:
556 windbg()
557 : stream() {}
558
559 ~windbg()
560 {
561 OutputDebugString(stream.str().c_str());
562 }
563
564 template <typename T>
565 windbg &operator<<(T const &that)
566 {
567 stream << that;
568 return *this;
569 }
570
571 private:
572 std::ostringstream stream;
573 };
574
575} // namespace clue
576
577#endif // clue_LOG_TO_DEBUGGER_WINDOWS
578
579#ifdef clue_LOG_TO_EVENTLOG
580
581namespace clue
582{
583
584 inline int to_eventlog_severity(int severity)
585 {
586 assert(clue_LOG_SEV_NONE <= severity && severity <= clue_LOG_SEV_MAX && "invalid severity");
587
588 switch (severity)
589 {
591 return EVENTLOG_INFORMATION_TYPE;
593 return EVENTLOG_ERROR_TYPE;
595 return EVENTLOG_ERROR_TYPE;
597 return EVENTLOG_ERROR_TYPE;
599 return EVENTLOG_ERROR_TYPE;
601 return EVENTLOG_WARNING_TYPE;
603 return EVENTLOG_INFORMATION_TYPE;
605 return EVENTLOG_INFORMATION_TYPE;
606 default:
608 return EVENTLOG_INFORMATION_TYPE;
609 }
610 }
611
612 class evtlog
613 {
614 public:
615 evtlog(int const severity, std::string const &module)
616 : severity(severity), module(module), stream() {}
617
618 ~evtlog()
619 {
620 // note string lifetime
621 const std::string text = stream.str();
622 const char *strings[] = {
623 text.c_str(),
624 };
625
626 const ::HANDLE hlog = ::RegisterEventSource(
627 0, text_or(module, "[clue]").c_str());
628
629 ::ReportEvent(
630 hlog // HANDLE hEventLog, // handle returned by RegisterEventSource
631 ,
632 to_eventlog_severity(severity) // WORD wType, // event type to log
633 ,
634 0 // WORD wCategory, // event category
635 ,
636 0 // DWORD dwEventID, // event identifier
637 ,
638 0 // PSID lpUserSid, // user security identifier (optional)
639 ,
640 1 // WORD wNumStrings, // number of strings to merge with message
641 ,
642 0 // DWORD dwDataSize, // size of binary data, in bytes
643 ,
644 strings // LPCTSTR *lpStrings, // array of strings to merge with message
645 ,
646 0 // LPVOID lpRawData // address of binary data
647 );
648
649 ::DeregisterEventSource(hlog);
650 }
651
652 template <typename T>
653 evtlog &operator<<(T const &that)
654 {
655 stream << that;
656 return *this;
657 }
658
659 private:
660 const int severity;
661 const std::string module;
662 std::ostringstream stream;
663 };
664
665} // namespace clue
666
667#endif // clue_LOG_TO_DEBUGGER_WINDOWS
668
669#ifdef clue_LOG_TO_SYSLOG
670
671namespace clue
672{
673
674 inline int to_syslog_severity(int severity)
675 {
676 assert(clue_LOG_SEV_NONE <= severity && severity <= clue_LOG_SEV_MAX && "invalid severity");
677
678 switch (severity)
679 {
681 return LOG_INFO;
683 return LOG_EMERG;
685 return LOG_ALERT;
687 return LOG_CRIT;
689 return LOG_ERR;
691 return LOG_WARNING;
693 return LOG_NOTICE;
695 return LOG_INFO;
696 default:
698 return LOG_DEBUG;
699 }
700 }
701
702 class syslog
703 {
704 public:
705 syslog(int const severity)
706 : severity(severity), stream() {}
707
708 ~syslog()
709 {
710 // emit: program-name[pid]:
711 ::openlog(NULL, LOG_PID, LOG_USER);
712 ::syslog(to_syslog_severity(severity), "%s", stream.str().c_str());
713 ::closelog();
714 }
715
716 template <typename T>
717 syslog &operator<<(T const &that)
718 {
719 stream << that;
720 return *this;
721 }
722
723 private:
724 const int severity;
725 std::ostringstream stream;
726 };
727
728} // namespace clue
729
730#endif // clue_LOG_TO_SYSLOG
731
732#ifdef clue_COMPILER_IS_MSVC
733#pragma warning(pop)
734#endif
735
736#endif // CLUE_CLUE_H_INCLUDED
#define clue_LOG_SEV_DEBUG_TEXT
Definition clue.hpp:201
#define clue_LOG_SEV_NONE
Definition clue.hpp:174
#define clue_LOG_SEV_NOTICE
Definition clue.hpp:180
#define LOG_ALERT
Definition clue.hpp:136
#define clue_LOG_SEV_NOTICE_TEXT
Definition clue.hpp:199
#define clue_LOG_SEV_CRITICAL
Definition clue.hpp:177
#define clue_LOG_SEV_DEBUG
Definition clue.hpp:182
#define clue_LOG_SEV_INFO_TEXT
Definition clue.hpp:200
#define clue_LOG_SEV_ALERT_TEXT
Definition clue.hpp:195
#define LOG_DEBUG
Definition clue.hpp:142
#define clue_LOG_SEV_WARNING_TEXT
Definition clue.hpp:198
#define clue_LOG_SEV_MAX
Definition clue.hpp:183
#define clue_LOG_SEV_EMERGENCY
Definition clue.hpp:175
#define clue_LOG_SEV_ERROR_TEXT
Definition clue.hpp:197
#define clue_LOG_SEV_NONE_TEXT
Definition clue.hpp:193
#define clue_LOG_SEV_ERROR
Definition clue.hpp:178
#define clue_LOG_SEV_WARNING
Definition clue.hpp:179
#define clue_LOG_SEV_INFO
Definition clue.hpp:181
#define clue_LOG_SEV_CRITICAL_TEXT
Definition clue.hpp:196
#define clue_LOG_SEV_ALERT
Definition clue.hpp:176
#define LOG_NOTICE
Definition clue.hpp:140
#define LOG_WARNING
Definition clue.hpp:139
#define LOG_INFO
Definition clue.hpp:141
#define clue_LOG_SEV_EMERGENCY_TEXT
Definition clue.hpp:194
Definition clue.hpp:370
std::string text_with_or(std::string const &prefix, std::string const &text, std::string const &postfix, std::string const &or_text)
Definition clue.hpp:379
bool is_true(bool const on)
Definition clue.hpp:372
std::string now_text()
Definition clue.hpp:446
std::string to_severities_text(int const level, std::string const &postfix=".", std::string const &result="")
Definition clue.hpp:412
std::string to_severity_text(int const severity)
Definition clue.hpp:389
std::string to_module_text(std::string const &module)
Definition clue.hpp:384
std::string text_or(std::string const &text, std::string const &or_text)
Definition clue.hpp:374