Develop Biology
The language of life
Engine.h
Go to the documentation of this file.
1/*
2 * This file is a part of the Biology project by eons LLC.
3 * Biology (aka Develop Biology) is a framework for approaching software
4 * development from a natural sciences perspective.
5 *
6 * Copyright (C) 2021 Séon O'Shannon & eons LLC
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
27#include <sstream>
28#include <stdarg.h>
29
30namespace bio {
31namespace log {
32
37class Engine
38{
39public:
40
44 Engine();
45
49 virtual ~Engine();
50
56 virtual void Output(const std::string& logString) = 0;
57
66 void Log(
67 Filter filter,
68 Level level,
69 const char* format,
70 va_list args
71 );
72
81 void Log(
82 Filter filter,
83 Level level,
84 const char* format,
85 ...
86 );
87
93 bool FilterPass(
94 Filter filter,
95 Level level
96 ) const;
97
104 bool FilterSet(
105 Filter filter,
106 Level level
107 );
108
115 bool FilterSet(
116 Name filter,
117 Name level
118 ); //calls StringTo...
119
124 Level FilterGet(Filter filter) const;
125
126protected:
131 std::ostringstream m_logMessage;
132
133private:
139 std::vector< Level > m_levelFilter;
140};
141} //log namespace
142} //bio namespace
Level FilterGet(Filter filter) const
Definition: Engine.cpp:135
std::ostringstream m_logMessage
Definition: Engine.h:131
virtual void Output(const std::string &logString)=0
virtual ~Engine()
Definition: Engine.cpp:45
bool FilterPass(Filter filter, Level level) const
Definition: Engine.cpp:108
bool FilterSet(Filter filter, Level level)
Definition: Engine.cpp:116
void Log(Filter filter, Level level, const char *format, va_list args)
Definition: Engine.cpp:50
Definition: Cell.h:31
const char * Name
Definition: Types.h:46