OnixS C++ CME MDP Conflated UDP Handler 1.1.2
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 {
42 Important = 10,
43
51 Regular = 50,
52
57 Debug = 100
58 };
59};
60
62ONIXS_CONFLATEDUDP_EXPORTED
63void
65 std::string&,
67
69inline
70std::string
73{
74 std::string str;
75
76 toStr(str, mode);
77
78 return str;
79}
80
82ONIXS_CONFLATEDUDP_EXPORTED
83bool
86 const Char*,
87 size_t);
88
91{
92 // Enumeration base.
93 typedef UInt32 Base;
94
96 enum Enum
97 {
100
103
106
109 };
110};
111
113ONIXS_CONFLATEDUDP_EXPORTED
114void
116 std::string&,
118
120inline
121std::string
124{
125 std::string str;
126
127 toStr(str, mode);
128
129 return str;
130}
131
133ONIXS_CONFLATEDUDP_EXPORTED
134bool
137 const Char*,
138 size_t);
139
142{
143public:
145 virtual void category(LogCategory::Enum) = 0;
146
148 virtual void source(const StrRef&) = 0;
149
151 virtual std::string& message() = 0;
152
158 virtual void commit() = 0;
159
160protected:
163 {
164 }
165
167 virtual ~LogEntry()
168 {
169 }
170
171private:
172 // Object copying is not supposed.
173
174 LogEntry(const LogEntry&);
175 LogEntry& operator =(const LogEntry&);
176};
177
180{
181 // Object copying is not supposed.
182
183 Logger(const Logger&);
184 Logger& operator =(const Logger&);
185
186protected:
189 {
190 }
191
192public:
194 virtual ~Logger()
195 {
196 }
197
200 virtual
201 void
203 std::string&) = 0;
204
214 virtual
215 LogEntry*
218};
219
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS
Definition Bootstrap.h:55
#define ONIXS_CONFLATEDUDP_LTWT_STRUCT
Definition Bootstrap.h:99
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
Abstraction of log entry in logging services.
Definition Logger.h:142
virtual std::string & message()=0
Editable text to be a message of log entry.
LogEntry()
Life-time is managed by Logger.
Definition Logger.h:162
virtual ~LogEntry()
Life-time is managed by Logger.
Definition Logger.h:167
virtual void category(LogCategory::Enum)=0
Specifies category of information being logged.
virtual void source(const StrRef &)=0
Specifies source of information being logged.
virtual void info(std::string &)=0
Logger()
Only descendants are to be created.
Definition Logger.h:188
virtual ~Logger()
Finalizes the instance.
Definition Logger.h:194
virtual LogEntry * addEntry(LogSeverity::Enum)=0
ONIXS_CONFLATEDUDP_EXPORTED bool fromStr(Decimal &, const Char *, size_t)
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
char Char
Character type alias.
Definition String.h:36
UInt32 UInt32
uInt32.
Definition Fields.h:261
Categories for information being logged.
Definition Logger.h:91
Enum
Categories for information being logged.
Definition Logger.h:97
@ Info
Log entry represents informational message.
Definition Logger.h:105
@ Warning
Log entry represents a warning.
Definition Logger.h:102
@ Error
Log entry represents an error.
Definition Logger.h:99
@ Debug
Log entry represents debug information.
Definition Logger.h:108
Defines severity levels for log entries.
Definition Logger.h:30