Remoto - VFS: VFS_logger.h Source File
Remoto - VFS
VFS_logger.h
Go to the documentation of this file.
1 #ifndef VFS_LOGGER_H
2 #define VFS_LOGGER_H
3 
4 #include "VFS_node.h"
5 
6 #include "utilities/colorPrint.h"
7 
8 class VFS_logger : public VFS_node
9 {
10  Q_OBJECT
11 
12  public:
13  Q_INVOKABLE explicit VFS_logger(int logLevel, int logTime, QString adminAddress);
14  ~VFS_logger();
15 
16  virtual VFS_node *find(VFS_request *r);
17 
18  protected:
24 
25  virtual void submit(VFS_request *r);
26 
27  private:
28  int _logLevel;
29  int _logTime;
30  QString _adminEmail;
31 
32  ColorPrint cp_bold;
33  ColorPrint cp_warn;
34  ColorPrint cp_error;
35 
36  void email(QString address, QString subject, QString message);
37 
38  protected slots:
39  virtual void applyDiff(VFS_request *t);
40 };
41 
42 #endif // VFS_LOGGER_H
A logger node with color formatting and different channels for message types.
Definition: VFS_logger.h:9
int _logLevel
Filter log entries by this value... lower entries are very important, higher ones are more fine-grain...
Definition: VFS_logger.h:28
int _logTime
Include log entry time, where 0 = none, 1 = locale time, 2 = locale time and date,...
Definition: VFS_logger.h:29
virtual void submit(VFS_request *r)
Submit settings to this logger.
Definition: VFS_logger.cpp:90
virtual VFS_node * find(VFS_request *r)
This method will return this if the path is settings, otherwise VFS_node::find().
Definition: VFS_logger.cpp:72
VFS_node * _critical
Crash may be imminent, the administrator address will be emailed this message if it is possible.
Definition: VFS_logger.h:23
ColorPrint cp_warn
Color settings for warning messages.
Definition: VFS_logger.h:33
VFS_node * _warnings
Warning logs, which provide non-critical information.
Definition: VFS_logger.h:21
ColorPrint cp_error
Color settings for error messages.
Definition: VFS_logger.h:34
VFS_node * _log
Message collector node, which subscribes to the other nodes as an aggregator.
Definition: VFS_logger.h:19
ColorPrint cp_bold
Color settings for bold printing.
Definition: VFS_logger.h:32
virtual void applyDiff(VFS_request *t)
Receive log information from a logging mechanism.
Definition: VFS_logger.cpp:192
void email(QString address, QString subject, QString message)
Email an administrator about a problem.
Definition: VFS_logger.cpp:266
QString _adminEmail
For CRITICAL() messages, this is the address that will be emailed.
Definition: VFS_logger.h:30
VFS_node * _messages
A message logging node.
Definition: VFS_logger.h:20
VFS_node * _errors
Error logs, which mean there is a problem but not a crash.
Definition: VFS_logger.h:22
Q_INVOKABLE VFS_logger(int logLevel, int logTime, QString adminAddress)
VFS_logger constructor.
Definition: VFS_logger.cpp:33
VFS_node is the base class from which all other VFS_node classes derive.
Definition: VFS_node.h:143
The base class for all requests between nodes.
Definition: VFS_node.h:54