Develop Biology
The language of life
Writer.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
30
31namespace bio {
32namespace log {
33
34class Engine;
35
42class Writer :
43 virtual public physical::Filterable,
44 public physical::Class< Writer >
45{
46public:
47
52 Writer)
53
54
57 Writer();
58
63 Writer(
64 Engine* logEngine,
65 Filter logFilter
66 );
67
71 virtual ~Writer();
72
81 void ExternalLog(
82 Filter logFilter,
83 Level level,
84 const char* format,
85 ...
86 ) const;
87
96 virtual void SetLogEngine(Engine* logEngine);
97
102
106 const Engine* GetLogEngine() const;
107
111 bool HasLogEngine() const;
112
113protected:
114
119 virtual void InitializeImplementation(ByteStreams args);
120
127 void Log(
128 Level level,
129 const char* format,
130 ...
131 ) const;
132
133private:
134 Engine* m_logEngine;
135};
136} //log namespace
137} //bio namespace
virtual ~Writer()
Definition: Writer.cpp:52
Engine * GetLogEngine()
Definition: Writer.cpp:62
Writer(Engine *logEngine, Filter logFilter)
Definition: Writer.cpp:31
BIO_DISAMBIGUATE_ALL_CLASS_METHODS(physical, Writer) Writer()
virtual void SetLogEngine(Engine *logEngine)
Definition: Writer.cpp:57
void Log(Level level, const char *format,...) const
Definition: Writer.cpp:77
virtual void InitializeImplementation(ByteStreams args)
Definition: Writer.cpp:128
void ExternalLog(Filter logFilter, Level level, const char *format,...) const
Definition: Writer.cpp:106
bool HasLogEngine() const
Definition: Writer.cpp:72
Definition: Cell.h:31
std::vector< ByteStream > ByteStreams
Definition: Types.h:52