Lightstreamer C++ Client SDK
Loading...
Searching...
No Matches
ConsoleLoggerProvider.h
Go to the documentation of this file.
1#ifndef INCLUDED_Lightstreamer_ConsoleLoggerProvider
2#define INCLUDED_Lightstreamer_ConsoleLoggerProvider
3
4#include "Lightstreamer/LoggerProvider.h"
5#include <map>
6#include <memory>
7
10#ifdef _MSC_VER
11 #if defined(HXCPP_DLL_IMPORT)
12 #define LIGHTSTREAMER_WIN_API __declspec(dllimport)
13 #elif defined (HXCPP_DLL_EXPORT)
14 #define LIGHTSTREAMER_WIN_API __declspec(dllexport)
15 #else
16 #define LIGHTSTREAMER_WIN_API
17 #endif
18 #define LIGHTSTREAMER_NIX_API
19#else
20 #if defined(HXCPP_DLL_EXPORT)
21 #define LIGHTSTREAMER_NIX_API __attribute__((visibility("default")))
22 #else
23 #define LIGHTSTREAMER_NIX_API
24 #endif
25 #define LIGHTSTREAMER_WIN_API
26#endif
27
28namespace Lightstreamer {
29
33enum class ConsoleLogLevel {
39 Trace = 0,
45 Debug = 10,
51 Info = 20,
57 Warn = 30,
63 Error = 40,
69 Fatal = 50
70};
71
77class LIGHTSTREAMER_NIX_API ConsoleLoggerProvider: public LoggerProvider {
78 ConsoleLogLevel _level;
79 std::map<std::string, std::unique_ptr<Logger>> _loggers;
80public:
86 ConsoleLoggerProvider(ConsoleLogLevel level) : _level(level) {}
87
88 LIGHTSTREAMER_WIN_API Logger* getLogger(const std::string& category) override;
89};
90
91} // namespace Lightstreamer
92
93#endif // INCLUDED_Lightstreamer_ConsoleLoggerProvider
ConsoleLogLevel
Logging level.
Definition ConsoleLoggerProvider.h:33
@ Info
Info logging level.
@ Warn
Warn logging level.
@ Fatal
Fatal logging level.
@ Error
Error logging level.
@ Debug
Debug logging level.
@ Trace
Trace logging level.
Simple concrete logging provider that logs on the system console.
Definition ConsoleLoggerProvider.h:77
ConsoleLoggerProvider(ConsoleLogLevel level)
Creates an instance of the concrete system console logger.
Definition ConsoleLoggerProvider.h:86
LIGHTSTREAMER_WIN_API Logger * getLogger(const std::string &category) override
Request for a Logger instance that will be used for logging occurring on the given category.
Interface to be implemented to consume log from the library.
Definition Logger.h:12
Simple interface to be implemented to provide custom log consumers to the library.
Definition LoggerProvider.h:14