libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
log
LoggerImpl.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_UTIL_LOGGER_IMPL_H
2
#define OSMSCOUT_UTIL_LOGGER_IMPL_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2015 Tim Teulings
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library 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 GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
#include <
osmscout/lib/CoreImportExport.h
>
24
25
#include <
osmscout/log/Logger.h
>
26
27
#include <sstream>
28
29
namespace
osmscout
{
30
37
class
OSMSCOUT_API
StreamLogger
:
public
Logger
38
{
39
private
:
45
class
OSMSCOUT_API
StreamDestination :
public
Destination
46
{
47
private
:
48
std::ostream& stream;
49
50
public
:
51
explicit
StreamDestination(std::ostream& stream);
52
53
void
Print(
const
std::string& value)
override
;
54
void
Print(
const
std::string_view& value)
override
;
55
void
Print(
const
char
* value)
override
;
56
void
Print(
bool
value)
override
;
57
void
Print(
short
value)
override
;
58
void
Print(
unsigned
short
value)
override
;
59
void
Print(
int
value)
override
;
60
void
Print(
unsigned
int
value)
override
;
61
void
Print(
long
value)
override
;
62
void
Print(
unsigned
long
value)
override
;
63
void
Print(
long
long
value)
override
;
64
void
Print(
unsigned
long
long
value)
override
;
65
void
PrintLn()
override
;
66
};
67
68
private
:
69
StreamDestination infoDestination;
70
StreamDestination errorDestination;
71
72
public
:
73
StreamLogger
(std::ostream& infoStream,
74
std::ostream& errorStream);
75
76
Line
Log
(
Level
level)
override
;
77
};
78
84
class
OSMSCOUT_API
ConsoleLogger
:
public
StreamLogger
85
{
86
public
:
87
ConsoleLogger
();
88
};
89
95
extern
OSMSCOUT_API
Log
log
;
96
}
97
112
113
#endif
CoreImportExport.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
Logger.h
osmscout::ConsoleLogger::ConsoleLogger
ConsoleLogger()
osmscout::Log
Definition
Logger.h:352
osmscout::Logger::Destination
Definition
Logger.h:65
osmscout::Logger::Line
Definition
Logger.h:113
osmscout::Logger::Level
Level
Definition
Logger.h:52
osmscout::Logger::Logger
Logger()=default
osmscout::StreamLogger::StreamLogger
StreamLogger(std::ostream &infoStream, std::ostream &errorStream)
osmscout::StreamLogger::Log
Line Log(Level level) override
osmscout::log
OSMSCOUT_API Log log
Definition
LoggerImpl.h:95
osmscout
Definition
Area.h:39
Generated by
1.17.0