AtilaCalculatorSoftware  2.3.4
C++ Interface for Atila fem resources files
log_entries.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Project: AtilaCalculatorSoftware
4  File: log_entries.h
5 
6  Copyright (c) 2020 - All rights reserved
7  Distributed under the MIT License (https://opensource.org/licenses/MIT)
8 
9 =========================================================================*/
10 #pragma once
11 #ifndef ATILACALCULATORSOFTWARE_LOG_ENTRIES_H
12 #define ATILACALCULATORSOFTWARE_LOG_ENTRIES_H
13 
14 #include "common.h"
15 #include "logger.h"
16 
17 #include <set>
18 #include <string>
19 #include <vector>
20 
25 class LogEntries : private std::vector<std::pair<LogMetaData, std::string>> {
26  public:
27  using vector::emplace_back;
28  using vector::push_back;
29  using vector::operator[];
30  using vector::begin;
31  using vector::end;
32  using vector::size;
33 
40  LogEntries filter(LogLevel lowest);
41 
50  LogEntries filter(LogLevel lowest, LogLevel highest);
51 
58  LogEntries filter(const std::set<LogLevel>& whitelist);
59 
67 
76  LogEntries exclude(LogLevel lowest, LogLevel highest);
77 
84  LogEntries exclude(const std::set<LogLevel>& blacklist);
85 
90  std::vector<std::string> formatted();
91 };
92 
93 #endif // ATILACALCULATORSOFTWARE_LOG_ENTRIES_H
std::vector< std::string > formatted()
Get log entries as formatted string.
Definition: log_entries.cpp:78
Contains the entries of the logger.
Definition: log_entries.h:25
LogEntries exclude(LogLevel level)
Filter logs to exclude the given logging levels from the entry.
Definition: log_entries.cpp:47
LogLevel
Logging level of a log entry, used to filter log entries, each filtering level will hide lower level ...
Definition: common.h:38
LogEntries filter(LogLevel lowest)
Filter logs to keep only entries above the given logging level (including itself) ...
Definition: log_entries.cpp:16