CLoggerBase.h
Go to the documentation of this file.
1 #ifndef ilog_CLoggerBase_included
2 #define ilog_CLoggerBase_included
3 
4 
5 // ACF includes
6 #include <istd/ILogger.h>
7 #include <ilog/ILoggable.h>
8 
9 
10 namespace ilog
11 {
12 
13 
14 class IMessageConsumer;
15 
16 
25  virtual public ILoggable,
26  virtual protected istd::ILogger
27 {
28 public:
29  CLoggerBase();
30 
31  // reimplemented (ilog::ILoggable)
32  virtual void SetLogPtr(ilog::IMessageConsumer* logPtr);
33  virtual ilog::IMessageConsumer* GetLogPtr() const;
34  virtual void SetTracingEnabled(bool trace);
35  virtual bool IsTracingEnabled() const;
36 
37 protected:
45  bool SendInfoMessage(
46  int id,
47  const QString& message,
48  const QString& messageSource = QString(),
49  int flags = 0) const;
50 
58  bool SendWarningMessage(
59  int id,
60  const QString& message,
61  const QString& messageSource = QString(),
62  int flags = 0) const;
63 
71  bool SendErrorMessage(
72  int id,
73  const QString& message,
74  const QString& messageSource = QString(),
75  int flags = 0) const;
76 
85  int id,
86  const QString& message,
87  const QString& messageSource = QString(),
88  int flags = 0) const;
89 
99  int id,
100  const QString& message,
101  const QString& messageSource = QString(),
102  int flags = 0) const;
103 
113  int id,
114  const QString& message,
115  const QString& messageSource = QString(),
116  int flags = 0) const;
117 
127  int id,
128  const QString& message,
129  const QString& messageSource = QString(),
130  int flags = 0) const;
131 
141  int id,
142  const QString& message,
143  const QString& messageSource = QString(),
144  int flags = 0) const;
145 
151  bool SendUserMessage(const istd::IInformationProvider* messagePtr) const;
152 
158  bool AllowMessageOnceAgain(int id);
159 
164  virtual void DecorateMessage(
166  int id,
167  int flags,
168  QString& message,
169  QString& messageSource) const;
170 
171  // reimplemented (istd::ILogger)
172  virtual bool IsLogConsumed(
174  const int* flagsPtr = NULL) const;
175  virtual bool SendLogMessage(
177  int id,
178  const QString& message,
179  const QString& messageSource,
180  int flags = 0) const;
181 
182 protected:
183  mutable QSet<int> m_onceMessageIds;
184 
185 private:
186  ilog::IMessageConsumer* m_logPtr;
187  bool m_isTracingEnabled;
188 };
189 
190 
191 } // namespace ilog
192 
193 
194 #endif // !ilog_CLoggerBase_included
195 
196 
bool AllowMessageOnceAgain(int id)
Reset message lock.
Base class implementing interface istd::ILogger sending log messages over ilog::IMessageConsumer.
Definition: CLoggerBase.h:24
Common interface for classes sending some log info.
Definition: ILogger.h:20
bool SendUserMessage(const istd::IInformationProvider *messagePtr) const
Send message with user object.
virtual void SetLogPtr(ilog::IMessageConsumer *logPtr)
Install log.
QSet< int > m_onceMessageIds
Definition: CLoggerBase.h:183
virtual bool SendLogMessage(istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const
Send any message to log.
bool SendCriticalMessageOnce(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send once critical message to log.
bool SendErrorMessageOnce(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send once error message to log.
Inteface for object, which support the.
Definition: ILoggable.h:15
bool SendErrorMessage(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send error message to log.
virtual void SetTracingEnabled(bool trace)
Enable/disable tracing.
virtual bool IsTracingEnabled() const
Returns true if tracing enabled.
InformationCategory
Category of information.
bool SendWarningMessage(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send warning message to log.
#define NULL
Definition: istd.h:64
bool SendInfoMessage(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send info message to log.
bool SendInfoMessageOnce(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send once info message to log.
bool SendCriticalMessage(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send critical message to log.
Common interface for a message container consuming information objects (messages).
Common interface for class providing some basic information object.
bool SendWarningMessageOnce(int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
Send once warning message to log.
virtual ilog::IMessageConsumer * GetLogPtr() const
Get log.
virtual bool IsLogConsumed(const istd::IInformationProvider::InformationCategory *categoryPtr=NULL, const int *flagsPtr=NULL) const
Check if any log message is consumed.
virtual void DecorateMessage(istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const
Decorate message parts before outputting.

© 2007-2017 Witold Gantzke and Kirill Lepskiy