summaryrefslogtreecommitdiff
path: root/src/core/common/Logger.hpp
blob: d180b6086b1824479344403f94b0b7b1a505ffc4 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
/*
    Ousía
    Copyright (C) 2014, 2015  Benjamin Paaßen, Andreas Stöckel

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * @file Logger.hpp
 *
 * Contains classes for logging messages in Ousía. Provides a generic Logger
 * class, and TerminalLogger, an extension of Logger which logs do an output
 * stream.
 *
 * @author Andreas Stöckel (astoecke@techfak.uni-bielefeld.de)
 */

#ifndef _OUSIA_LOGGER_HPP_
#define _OUSIA_LOGGER_HPP_

#include <cstdint>
#include <ostream>
#include <string>
#include <vector>

#include "Exceptions.hpp"
#include "Location.hpp"

namespace ousia {

/**
 * Enum containing the severities used for logging errors and debug messages.
 */
enum class Severity : uint8_t {
	/**
     * Indicates that this message was only printed for debugging. Note that
     * in release builds messages with this severity are discarded.
     */
	DEBUG = 0,

	/**
     * A message which might provide additional information to the user.
     */
	NOTE = 1,

	/**
     * A message which warns of possible mistakes by the user which might not be
     * actual errors but may lead to unintended behaviour.
     */
	WARNING = 2,

	/**
     * An error occurred while processing, however program execution continues,
     * trying to deal with the error situation (graceful degradation). However,
     * messages with this severity may be followed up by fatal errors.
     */
	ERROR = 3,

	/**
     * A fatal error occurred. Program execution cannot continue.
     */
	FATAL_ERROR = 4
};

// Forward declaration
class LoggerFork;
class ScopedLogger;

/**
 * The Logger class is the base class the individual logging systems should
 * derive from. It provides a simple interface for logging errors, warnings and
 * notes and filters these according to the set minimum severity. Additionally
 * a stack of file names is maintained in order to allow simple descent into
 * included files. Note however, that this base Logger class simply discards the
 * incomming log messages. Use one of the derived classes to actually handle the
 * log messages.
 */
class Logger {
public:
	friend LoggerFork;
	friend ScopedLogger;

	/**
	 * Describes a file inclusion.
	 */
	struct File {
		/**
		 * Current filename.
		 */
		std::string file;

		/**
		 * Location at which the file was included.
		 */
		SourceLocation loc;

		/**
		 * Callback used to retrieve the context for a certain location
		 */
		SourceContextCallback ctxCallback;

		/**
		 * Data to be passed to the callback.
		 */
		void *ctxCallbackData;

		/**
		 * Constructor of the Scope struct.
		 *
		 * @param type is the type of
		 * @param file is the name of the current file.
		 * @param loc is the location at which the file was included.
		 * @param ctxCallback is the callback function that should be called
		 * for looking up the context belonging to a SourceLocation instance.
		 * @param ctxCallbackData is additional data that should be passed to
		 * the callback function.
		 */
		File(std::string file, SourceLocation loc,
		     SourceContextCallback ctxCallback, void *ctxCallbackData)
		    : file(std::move(file)),
		      loc(loc),
		      ctxCallback(ctxCallback),
		      ctxCallbackData(ctxCallbackData)
		{
		}
	};

	/**
	 * The message struct represents a single log message and all information
	 * attached to it.
	 */
	struct Message {
		/**
		 * Severity of the log message.
		 */
		Severity severity;

		/**
		 * Actual log message.
		 */
		std::string msg;

		/**
		 * Location passed along with the message.
		 */
		SourceLocation loc;

		/**
		 * Constructor of the Message struct.
		 *
		 * @param severity describes the message severity.
		 * @param msg contains the actual message.
		 */
		Message(Severity severity, std::string msg, const SourceLocation &loc)
		    : severity(severity), msg(std::move(msg)), loc(loc){};
	};

protected:
	/**
	 * Function to be overriden by child classes to actually display or store
	 * the messages. The default implementation just discards all incomming
	 * messages.
	 *
	 * @param msg is an instance of the Message struct containing the data that
	 * should be logged.
	 */
	virtual void processMessage(const Message &msg) {}

	/**
	 * Called right before the processMessage function is called. Allows any
	 * concrete implementation of the Logger class to discard certain messages.
	 *
	 * @param msg is the message that should be filtered.
	 * @return true if the message should be passed to the processMessage
	 * method, false otherwise.
	 */
	virtual bool filterMessage(const Message &msg) { return true; }

	/**
	 * Called whenever a new file is pushed onto the stack.
	 *
	 * @param file is the file structure that should be stored on the stack.
	 */
	virtual void processPushFile(const File &file) {}

	/**
	 * Called whenever a scope is popped from the stack.
	 */
	virtual void processPopFile() {}

	/**
	 * Called whenever the setDefaultLocation function is called.
	 *
	 * @param loc is the default location that should be set.
	 */
	virtual void processSetDefaultLocation(const SourceLocation &loc) {}

public:
	/**
	 * Virtual destructor.
	 */
	virtual ~Logger(){};

	// Default constructor
	Logger() {}

	// No copy
	Logger(const Logger &) = delete;

	// No assign
	Logger &operator=(const Logger &) = delete;

	/**
	 * Logs the given message. The file name is set to the topmost file name on
	 * the file name stack.
	 *
	 * @param severity is the severity of the log message.
	 * @param msg is the actual log message.
	 * @param loc is the location in the source file the message refers to.
	 */
	void log(Severity severity, const std::string &msg,
	         const SourceLocation &loc = SourceLocation{});

	/**
	 * Logs the given loggable exception.
	 *
	 * @param ex is the exception that should be logged.
	 */
	void log(const LoggableException &ex)
	{
		log(Severity::ERROR, ex.msg, ex.getLocation());
	}

	/**
	 * Logs the given message. The file name is set to the topmost file name on
	 * the file name stack.
	 *
	 * @param severity is the severity of the log message.
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides location
	 * information.
	 */
	template <class LocationType>
	void log(Severity severity, const std::string &msg, LocationType &loc)
	{
		log(severity, msg, loc.getLocation());
	}

	/**
	 * Logs a debug message. Debug messages will be discarded if the software
	 * is compiled in the release mode (with the NDEBUG flag).
	 *
	 * @param msg is the actual log message.
	 * @param loc is the location in the source file the message refers to.
	 */
	void debug(const std::string &msg,
	           const SourceLocation &loc = SourceLocation{})
	{
#ifndef NDEBUG
		log(Severity::DEBUG, msg, loc);
#endif
	}

	/**
	 * Logs a debug message. Debug messages will be discarded if the software
	 * is compiled in the release mode.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 * information.
	 */
	template <class LocationType>
	void debug(const std::string &msg, LocationType &loc)
	{
#ifndef NDEBUG
		log(Severity::DEBUG, msg, loc);
#endif
	}

	/**
	 * Logs a note.
	 *
	 * @param msg is the actual log message.
	 * @param loc is the location in the source file the message refers to.
	 */
	void note(const std::string &msg,
	          const SourceLocation &loc = SourceLocation{})
	{
		log(Severity::NOTE, msg, loc);
	}

	/**
	 * Logs a note.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 * information.
	 */
	template <class LocationType>
	void note(const std::string &msg, LocationType &loc)
	{
		log(Severity::NOTE, msg, loc);
	}

	/**
	 * Logs a warning.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 */
	void warning(const std::string &msg,
	             const SourceLocation &loc = SourceLocation{})
	{
		log(Severity::WARNING, msg, loc);
	}

	/**
	 * Logs a warning.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 * information.
	 */
	template <class LocationType>
	void warning(const std::string &msg, LocationType &loc)
	{
		log(Severity::WARNING, msg, loc);
	}

	/**
	 * Logs an error message.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 */
	void error(const std::string &msg,
	           const SourceLocation &loc = SourceLocation{})
	{
		log(Severity::ERROR, msg, std::move(loc));
	}

	/**
	 * Logs an error message.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 * information.
	 */
	template <class LocationType>
	void error(const std::string &msg, LocationType &loc)
	{
		log(Severity::ERROR, msg, loc);
	}

	/**
	 * Logs a fatal error message.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 */
	void fatalError(const std::string &msg,
	                const SourceLocation &loc = SourceLocation{})
	{
		log(Severity::FATAL_ERROR, msg, loc);
	}

	/**
	 * Logs a fatal error message.
	 *
	 * @param msg is the actual log message.
	 * @param loc is a reference to a variable which provides position
	 * information.
	 */
	template <class LocationType>
	void fatalError(const std::string &msg, LocationType &loc)
	{
		log(Severity::FATAL_ERROR, msg, loc);
	}

	/**
	 * Pushes a new file name onto the internal filename stack.
	 *
	 * @param name is the name of the file to be added to the stack.
	 * @param loc is the position from which the new file is included.
	 * @param ctxCallback is the callback function that should be called if a
	 * SourceLocation needs to be resolved to a SourceContext.
	 * @param ctxCallbackData is the data that should be passed to the callback.
	 */
	void pushFile(std::string name, SourceLocation loc = SourceLocation{},
	              SourceContextCallback ctxCallback = nullptr,
	              void *ctxCallbackData = nullptr)
	{
		processPushFile(
		    File(std::move(name), loc, ctxCallback, ctxCallbackData));
	}

	/**
	 * Pops the filename from the internal filename stack. Resets any location
	 * set by the setDefaultLocation() method.
	 */
	void popFile()
	{
		processPopFile();
		resetDefaultLocation();
	}

	/**
	 * Sets the default location. The default location is automatically reset
	 * once the popFile() method is called.
	 *
	 * @param loc is the location that should be used if no (valid) location is
	 * specified in the Logger.
	 */
	void setDefaultLocation(const SourceLocation &loc)
	{
		processSetDefaultLocation(loc);
	}

	/**
	 * Resets the default location, a previously set default location will be
	 * no longer used.
	 */
	void resetDefaultLocation() { processSetDefaultLocation(SourceLocation{}); }

	/**
	 * Returns a forked logger instance which can be used to collect log
	 * messages for which it is not sure whether they will be used.
	 *
	 * @return a LoggerFork instance which buffers all method calls and commits
	 * them once the "commit()" method is called.
	 */
	LoggerFork fork();
};

/**
 * Fork of the Logger -- stores all logged messages without actually pushing
 * them to the underlying logger instance. Maintains its own
 * maxEncounteredSeverity independently from the parent Logger instance.
 * Internally the LoggerFork class records all calls to the internal
 * processMessage, processPushScope and processPopFile calls and replays these
 * calls in the exact order on the parent Logger instance once the commit
 * function is called.
 */
class LoggerFork : public Logger {
private:
	friend Logger;

	/**
	 * Intanally used to store the incomming function calls.
	 */
	enum class CallType { MESSAGE, PUSH_FILE, POP_FILE, SET_DEFAULT_LOCATION };

	/**
	 * Datastructure used to represent a logger function call.
	 */
	struct Call {
		/**
		 * Type of the function call.
		 */
		CallType type;

		/**
		 * Index of the associated data in the type-specific vector.
		 */
		size_t dataIdx;

		/**
		 * Constructor of the Call structure.
		 *
		 * @param type is the type of the call.
		 * @param dataIdx is the index of the associated data in the type
		 * specific data vector.
		 */
		Call(CallType type, size_t dataIdx) : type(type), dataIdx(dataIdx) {}
	};

	/**
	 * Vector storing all incomming calls.
	 */
	std::vector<Call> calls;

	/**
	 * Vector storing all incomming messages.
	 */
	std::vector<Message> messages;

	/**
	 * Vector storing all incomming pushed Scope instances.
	 */
	std::vector<File> files;

	/**
	 * Vector storing all incomming location instances.
	 */
	std::vector<SourceLocation> locations;

	/**
	 * Parent logger instance.
	 */
	Logger *parent;

	/**
	 * Constructor of the LoggerFork class.
	 *
	 * @param parent is the parent logger instance.
	 */
	LoggerFork(Logger *parent) : parent(parent) {}

protected:
	void processMessage(const Message &msg) override;
	void processPushFile(const File &file) override;
	void processPopFile() override;
	void processSetDefaultLocation(const SourceLocation &loc) override;

public:
	// Default move constructor
	LoggerFork(LoggerFork &&l)
	    : calls(std::move(l.calls)),
	      messages(std::move(l.messages)),
	      files(std::move(l.files)),
	      locations(std::move(l.locations)),
	      parent(std::move(l.parent)){};

	/**
	 * Commits all collected messages to the parent Logger instance.
	 */
	void commit();

	/**
	 * Purges all collected messages. Resets the LoggerFork to its initial
	 * state (except for the maximum encountered severity).
	 */
	void purge();
};

/**
 * The ScopedLogger class can be used to automatically pop any pushed file from
 * the File stack maintained by a Logger class (in a RAII manner). This
 * simplifies managing pushing and popping files in case there are multiple
 * return calls or exceptions thrown.
 */
class ScopedLogger : public Logger {
private:
	/**
	 * Reference to the parent logger instance.
	 */
	Logger &parent;

	/**
	 * Number of push calls.
	 */
	size_t depth;

protected:
	/**
	 * Relays the processMessage call to the parent logger.
	 *
	 * @param msg is the message to be relayed to the parent logger.
	 */
	void processMessage(const Message &msg) override
	{
		parent.processMessage(msg);
	}

	/**
	 * Relays the filterMessage call to the parent logger.
	 *
	 * @param msg is the message to be relayed to the parent logger.
	 */
	bool filterMessage(const Message &msg) override
	{
		return parent.filterMessage(msg);
	}

	/**
	 * Relays the processPushFile call to the parent logger and increments the
	 * stack depth counter.
	 *
	 * @param file is the File instance to be relayed to the parent logger.
	 */
	void processPushFile(const File &file)
	{
		parent.processPushFile(file);
		depth++;
	}

	/**
	 * Relays the processPopFile call to the parent logger and decrements the
	 * stack depth counter.
	 */
	void processPopFile()
	{
		depth--;
		parent.processPopFile();
	}

	/**
	 * Relays the processSetDefaultLocation call to the parent logger.
	 *
	 * @param loc is the location to be passed to the parent logger.
	 */
	void processSetDefaultLocation(const SourceLocation &loc)
	{
		parent.processSetDefaultLocation(loc);
	}

public:
	/**
	 * Constructor of the ScopedLogger class.
	 *
	 * @param parent is the parent logger instance to which all calls should
	 * be relayed.
	 */
	ScopedLogger(Logger &parent) : Logger(), parent(parent) {}

	/**
	 * Constructor of the ScopedLogger class, pushes a first file instance onto
	 * the file stack.
	 *
	 * @param parent is the parent logger instance to which all calls should
	 * be relayed.
	 * @param name is the name of the file to be added to the stack.
	 * @param loc is the position from which the new file is included.
	 * @param ctxCallback is the callback function that should be called if a
	 * SourceLocation needs to be resolved to a SourceContext.
	 * @param ctxCallbackData is the data that should be passed to the callback.
	 */
	ScopedLogger(Logger &parent, std::string name,
	             SourceLocation loc = SourceLocation{},
	             SourceContextCallback ctxCallback = nullptr,
	             void *ctxCallbackData = nullptr)
	    : Logger(), parent(parent)
	{
		pushFile(name, loc, ctxCallback, ctxCallbackData);
	}

	/**
	 * Destructor of the ScopedLogger class, automatically unwinds the file
	 * stack.
	 */
	~ScopedLogger()
	{
		while (depth > 0) {
			processPopFile();
		}
	}
};

#ifdef NDEBUG
constexpr Severity DEFAULT_MIN_SEVERITY = Severity::NOTE;
#else
constexpr Severity DEFAULT_MIN_SEVERITY = Severity::DEBUG;
#endif

/**
 * The ConcreteLogger class contains data fields used to specify the minimum
 * severity and to gather statistics about encountered log messages.
 * Additionally it provides the File stack and helper functions that can be
 * used to access location and context of a given message.
 */
class ConcreteLogger : public Logger {
private:
	/**
	 * Stack containing the current file instance.
	 */
	std::vector<File> files;

	/**
	 * Vector used to store the counts of each message type.
	 */
	std::vector<size_t> messageCounts;

	/**
	 * Minimum severity to be used for filtering messages.
	 */
	Severity minSeverity;

	/**
	 * Current default location.
	 */
	SourceLocation defaultLocation;

protected:
	/**
	 * Filters the messages according to the given minimum severity.
	 *
	 * @param msg is the message that should be filtered.
	 * @return true if the message has a higher or equal severity compared to
	 * the minimum severity.
	 */
	bool filterMessage(const Message &msg) override;

	/**
	 * Pushes the given file descriptor onto the internal file stack.
	 *
	 * @param file is the File descriptor to be pushed onto the internal file
	 * stack.
	 */
	void processPushFile(const File &file) override;

	/**
	 * Pops the given file descriptor from the internal file stack.
	 */
	void processPopFile() override;

	/**
	 * Sets the default location.
	 *
	 * @param loc is the new default location.
	 */
	void processSetDefaultLocation(const SourceLocation &loc) override;

public:
	/**
	 * Creates a ConcreteLogger instance with the given minimum severity.
	 *
	 * @param minSeverity is the severity below which message should be
	 * discarded.
	 */
	ConcreteLogger(Severity minSeverity = DEFAULT_MIN_SEVERITY)
	    : minSeverity(minSeverity)
	{
	}

	/**
	 * Returns the name of the current file or an empty instance of the File
	 * instance if no current file is available.
	 *
	 * @return the name of the current file.
	 */
	const File &currentFile() const;

	/**
	 * Returns the current filename or an empty string if no surch file is
	 * available.
	 */
	const std::string &currentFilename() const;

	/**
	 * Returns the current cursor location.
	 *
	 * @return the current cursor location.
	 */
	const SourceLocation &messageLocation(const Message &msg) const;

	/**
	 * Returns the current cursor context.
	 *
	 * @return the current cursor context.
	 */
	SourceContext messageContext(const Message &msg) const;

	/**
	 * Returns the maximum encountered severity.
	 *
	 * @return the maximum encountered severity.
	 */
	Severity getMaxEncounteredSeverity();

	/**
	 * Returns the number of messages for the given severity.
	 *
	 * @param severity is the log severity for which the message count should
	 * be returned.
	 * @return the number of messages for this severity. Returns zero for
	 * invalid arguments.
	 */
	size_t getSeverityCount(Severity severity);

	/**
	 * Resets the statistics gathered by the ConcreteLogger instance (the number
	 * of messages per log severity) and the internal file stack.
	 */
	void reset();

	/**
	 * Returns true if at least one message with either a fatal error or error
	 * severity was logged.
	 *
	 * @return true if an error or fatal error was logged.
	 */
	bool hasError();
};

/**
 * Class extending the Logger class and printing the log messages to the given
 * stream.
 */
class TerminalLogger : public ConcreteLogger {
private:
	/**
	 * Reference to the target output stream.
	 */
	std::ostream &os;

	/**
	 * If true, the TerminalLogger will use colors to make the log messages
	 * prettier.
	 */
	bool useColor;

protected:
	void processMessage(const Message &msg) override;

public:
	/**
	 * Constructor of the TerminalLogger class.
	 *
	 * @param os is the output stream the log messages should be logged to.
	 * Should be set to std::cerr in most cases.
	 * @param useColor if true, the TerminalLogger class will do its best to
	 * use ANSI/VT100 control sequences for colored log messages.
	 * @param minSeverity is the minimum severity below which log messages are
	 * discarded.
	 */
	TerminalLogger(std::ostream &os, bool useColor = false,
	               Severity minSeverity = DEFAULT_MIN_SEVERITY)
	    : ConcreteLogger(minSeverity), os(os), useColor(useColor)
	{
	}
};
}

#endif /* _OUSIA_LOGGER_HPP_ */