OnixS C++ CME MDP Premium Market Data Handler 5.10.3
Users' manual and API documentation
Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
25
27
30{
33
35 enum Enum
36 {
43
51 Regular = 50,
52
57 Debug = 100
58 };
59};
60
63void toStr(std::string&, LogSeverity::Enum);
64
66inline std::string toStr(LogSeverity::Enum mode)
67{
68 std::string str;
69
70 toStr(str, mode);
71
72 return str;
73}
74
78
81{
82 // Enumeration base.
84
86 enum Enum
87 {
90
93
96
99 };
100};
101
104void toStr(std::string&, LogCategory::Enum);
105
107inline std::string toStr(LogCategory::Enum mode)
108{
109 std::string str;
110
111 toStr(str, mode);
112
113 return str;
114}
115
119
122{
123public:
125 virtual void category(LogCategory::Enum) = 0;
126
128 virtual void source(const Messaging::StrRef&) = 0;
129
131 virtual std::string& message() = 0;
132
138 virtual void commit() = 0;
139
140protected:
143
145 virtual ~LogEntry() {}
146
147private:
148 // Object copying is not supposed.
149
150 LogEntry(const LogEntry&);
151 LogEntry& operator=(const LogEntry&);
152};
153
156{
157public:
159 virtual ~Logger() = default;
160
163 virtual void info(std::string&) = 0;
164
175
176protected:
178 Logger() = default;
179
180private:
181 // Object copying is not supposed.
182
183 Logger(const Logger&) = delete;
184 Logger& operator=(const Logger&) = delete;
185};
186
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:54
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:55
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:148
Abstraction of log entry in logging services.
Definition Logger.h:122
virtual void source(const Messaging::StrRef &)=0
Specifies source of information being logged.
virtual std::string & message()=0
Editable text to be a message of log entry.
LogEntry()
Life-time is managed by Logger.
Definition Logger.h:142
virtual void commit()=0
virtual ~LogEntry()
Life-time is managed by Logger.
Definition Logger.h:145
virtual void category(LogCategory::Enum)=0
Specifies category of information being logged.
virtual void info(std::string &)=0
virtual ~Logger()=default
Finalizes the instance.
virtual LogEntry * addEntry(LogSeverity::Enum)=0
Logger()=default
Only descendants are to be created.
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
char Char
Character type alias.
Definition String.h:30
std::basic_string_view< Char > StrRef
Definition StrRef.h:46
void fromStr(NifList &, const std::string &, const std::string &=std::string("; ,"))
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Categories for information being logged.
Definition Logger.h:81
Enum
Categories for information being logged.
Definition Logger.h:87
@ Info
Log entry represents informational message.
Definition Logger.h:95
@ Warning
Log entry represents a warning.
Definition Logger.h:92
@ Error
Log entry represents an error.
Definition Logger.h:89
@ Debug
Log entry represents debug information.
Definition Logger.h:98
Messaging::UInt32 Base
Definition Logger.h:83
Defines severity levels for log entries.
Definition Logger.h:30
Enum
Log alternates.
Definition Logger.h:36
Messaging::UInt32 Base
Enumeration base.
Definition Logger.h:32