OnixS C++ CME MDP Conflated UDP Handler 1.1.2
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
25
28
30
33{
34 std::string filename_;
35 UInt64 fileSizeLimit_;
36
37 LogSeverity::Enum severity_;
38
39 WatchService* watch_;
40
41public:
44 : filename_()
45 , fileSizeLimit_(2145386496)
46 , severity_(LogSeverity::Regular)
47 , watch_(&UtcWatch::service())
48 {
49 }
50
55
59 const std::string& filename() const
60 {
61 return filename_;
62 }
63
67 void filename(const std::string& value)
68 {
69 filename_ = value;
70 }
71
79 {
80 return fileSizeLimit_;
81 }
82
85 {
86 fileSizeLimit_ = value;
87 }
88
94 {
95 return severity_;
96 }
97
101 {
102 severity_ = value;
103 }
104
108 {
109 return *watch_;
110 }
111
115 {
116 watch_ = &watch;
117 }
118};
119
121ONIXS_CONFLATEDUDP_EXPORTED
122std::string
124
126
129{
135 virtual
136 void
138 const FileLogger&,
139 const Char*)
140 {
141 }
142};
143
148{
149 // File logger machinery implementation.
151
152 Workhorse* workhorse_;
153
154public:
157 const FileLoggerSettings&,
158 FileLoggerListener* = NULL);
159
162
164 const
166 settings() const;
167
170 void
172 std::string&);
173
179 LogEntry*
182
191 std::string rollover();
192};
193
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS
Definition Bootstrap.h:55
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS_DECL(typeName)
Definition Bootstrap.h:47
#define ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
Definition Bootstrap.h:59
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_LTWT_CLASS_DECL(name)
Definition Bootstrap.h:107
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
Base parameters affecting synchronous logging services.
Definition FileLogger.h:33
void severityLevel(LogSeverity::Enum value)
Definition FileLogger.h:100
const std::string & filename() const
Definition FileLogger.h:59
LogSeverity::Enum severityLevel() const
Definition FileLogger.h:93
void filename(const std::string &value)
Definition FileLogger.h:67
FileLoggerSettings()
Initializes parameters with default values.
Definition FileLogger.h:43
void fileSizeLimit(UInt64 value)
Sets logFileSizeLimit.
Definition FileLogger.h:84
~FileLogger()
Disposes logging machinery.
LogEntry * addEntry(LogSeverity::Enum)
FileLogger(const FileLoggerSettings &, FileLoggerListener *=NULL)
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
UInt64 UInt64
uInt64.
Definition Fields.h:265
char Char
Character type alias.
Definition String.h:36
UInt32 UInt32
uInt32.
Definition Fields.h:261
ONIXS_CONFLATEDUDP_EXPORTED std::string makeLogFilename(UInt32)
Makes filename for log file for the given channel.
Collection of events raised by FileLogger during its life time.
Definition FileLogger.h:129
virtual void onFileLoggerIssue(const FileLogger &, const Char *)
Definition FileLogger.h:137
Defines severity levels for log entries.
Definition Logger.h:30
Abstract watch service.
Definition Watch.h:30