OnixS C++ CME MDP Premium Market Data Handler 5.9.0
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{
32 typedef UInt32 Base;
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
77bool fromStr(LogSeverity::Enum&, const Char*, size_t);
78
81{
82 // Enumeration base.
83 typedef UInt32 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
118bool fromStr(LogCategory::Enum&, const Char*, size_t);
119
122{
123public:
125 virtual void category(LogCategory::Enum) = 0;
126
128 virtual void source(const 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() {}
160
163 virtual void info(std::string&) = 0;
164
175
176protected:
179
180private:
181 // Object copying is not supposed.
182
183 Logger(const Logger&);
184 Logger& operator=(const Logger&);
185};
186
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:67
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:68
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:171
Abstraction of log entry in logging services.
Definition Logger.h:122
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
Commits entry into a log and releases the instance.
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 source(const StrRef &)=0
Specifies source of information being logged.
Abstraction of logger.
Definition Logger.h:156
virtual void info(std::string &)=0
Basic information on the implementation of the logging services.
Logger()
Only descendants are to be created.
Definition Logger.h:178
virtual ~Logger()
Finalizes the instance.
Definition Logger.h:159
virtual LogEntry * addEntry(LogSeverity::Enum)=0
Adds entry to the log.
Provides efficient way of accessing text-based values without copying content of the text being refer...
Definition String.h:42
bool fromStr(Decimal &, const Char *, size_t)
Deserializes a decimal number from the given text presentation.
char Char
Character type alias.
Definition String.h:36
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
UInt32 UInt32
uInt32.
Definition Fields.h:202
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
Defines severity levels for log entries.
Definition Logger.h:30
Enum
Log alternates.
Definition Logger.h:36
@ Regular
Handler will log miscellaneous aspects related with its execution like changes in state,...
Definition Logger.h:51
@ Important
Only important information like warnings and errors will be logged.
Definition Logger.h:42
@ Debug
In addition to the data logged in 'Regular' mode, Handler will output additional information like ste...
Definition Logger.h:57