OnixS C++ CME MDP Streamlined Market Data Handler 1.2.0
API Documentation
Loading...
Searching...
No Matches
FileLogger.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
27
29
32{
33 std::string filename_;
34 UInt64 fileSizeLimit_;
35
36 LogSeverity::Enum severity_;
37
38 WatchService* watch_;
39
40public:
43 : filename_()
44 , fileSizeLimit_(2145386496)
45 , severity_(LogSeverity::Regular)
46 , watch_(&UtcWatch::service())
47 {
48 }
49
54
58 const std::string& filename() const
59 {
60 return filename_;
61 }
62
66 void filename(const std::string& value)
67 {
68 filename_ = value;
69 }
70
78 {
79 return fileSizeLimit_;
80 }
81
84 {
85 fileSizeLimit_ = value;
86 }
87
93 {
94 return severity_;
95 }
96
100 {
101 severity_ = value;
102 }
103
107 {
108 return *watch_;
109 }
110
114 {
115 watch_ = &watch;
116 }
117};
118
121std::string
123
125
128{
134 virtual
135 void
137 const FileLogger&,
138 const Char*)
139 {
140 }
141};
142
147{
148 // File logger machinery implementation.
150 Workhorse* workhorse_;
151
152public:
155 const FileLoggerSettings&,
157
160
162 const
164 settings() const;
165
171 LogEntry*
174
183 std::string rollover();
184};
185
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED_STRUCT
Definition Bootstrap.h:67
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS_DECL(typeName)
Definition Bootstrap.h:55
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS
Definition Bootstrap.h:63
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:169
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition Bootstrap.h:173
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS_DECL(name)
Definition Bootstrap.h:123
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition Bootstrap.h:111
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED
Definition Compiler.h:160
#define ONIXS_CMESTREAMLINEDMDH_NULLPTR
Definition Compiler.h:167
Base parameters affecting synchronous logging services.
Definition FileLogger.h:32
void severityLevel(LogSeverity::Enum value)
Specifies whether logger should output its events and which of events should be put into the log.
Definition FileLogger.h:99
const std::string & filename() const
Log file name.
Definition FileLogger.h:58
LogSeverity::Enum severityLevel() const
Specifies whether the logger should output events and which of events should be put into the log.
Definition FileLogger.h:92
void filename(const std::string &value)
Updates log file name.
Definition FileLogger.h:66
UInt64 fileSizeLimit() const
Log file size limit (in bytes).
Definition FileLogger.h:77
FileLoggerSettings()
Initializes parameters with default values.
Definition FileLogger.h:42
void watch(WatchService &watch)
Watch service used by logger while assigning timestamps to log entries.
Definition FileLogger.h:113
WatchService & watch() const
Watch service used by logger while assigning timestamps to log entries.
Definition FileLogger.h:106
void fileSizeLimit(UInt64 value)
Sets logFileSizeLimit.
Definition FileLogger.h:83
Implements logging services to put logged data into a regular file.
Definition FileLogger.h:147
~FileLogger()
Disposes logging machinery.
LogEntry * addEntry(LogSeverity::Enum)
Adds a new entry into the log.
std::string rollover()
Rolls over current log and starts recording a new chunk.
FileLogger(const FileLoggerSettings &, FileLoggerListener *=nullptr)
Initializes logger according to given settings.
const FileLoggerSettings & settings() const
Configuration of given logger instance.
Abstraction of log entry in logging services.
Definition Logger.h:142
std::string makeLogFilename(UInt32)
Makes filename for log file for the given channel.
char Char
Character type alias.
Definition String.h:36
Collection of events raised by FileLogger during its life time.
Definition FileLogger.h:128
virtual void onFileLoggerIssue(const FileLogger &, const Char *)
Invoked by FileLogger in case of issue.
Definition FileLogger.h:136
Defines severity levels for log entries.
Definition Logger.h:30