libosmscout 1.1.1
Loading...
Searching...
No Matches
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
24
25#include <osmscout/log/Logger.h>
26
27#include <sstream>
28
29namespace osmscout {
30
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
85 {
86 public:
88 };
89
96}
97
112
113#endif
#define OSMSCOUT_API
Definition CoreImportExport.h:45
Definition Logger.h:352
Definition Logger.h:65
Definition Logger.h:113
Level
Definition Logger.h:52
Logger()=default
StreamLogger(std::ostream &infoStream, std::ostream &errorStream)
Line Log(Level level) override
OSMSCOUT_API Log log
Definition LoggerImpl.h:95
Definition Area.h:39