10 #include "utilities/colorPrint.h"
21 VFS(QString configFile, QStringList plugins=QStringList(),
bool describe=
false,
bool printConfig=
false);
24 static void LOG(QString message,
int level=0, QString user=
"server");
25 static void WARN(QString message,
int level=0, QString user=
"server");
26 static void ERROR(QString message,
int level=0, QString user=
"server");
27 static void CRITICAL(QString message);
41 virtual QByteArray
icon();
VFS_creator is a static class used to instantiate nodes.
VFS_node is the base class from which all other VFS_node classes derive.
A thread interface for creating multithreaded applications.
VFS is the root node for a Virtual Filesystem.
static QJsonObject _parameters
VFS parameters, defined in a config file.
ColorPrint cp_bold
Color settings for bold printing.
void timerEvent(QTimerEvent *event)
Timer handler for VFS timer events.
static QMap< QString, QDateTime > _monitoredFiles
A list of path:datetime entries that the VFS will monitor for changes.
static VFS * root()
Return the root node of the VFS filesystem.
int _logLevel
Filter log entries by this value... lower entries are very important, higher ones are more fine-grain...
void setLogSettings(int loglevel, int logtime)
Set the loglevel and logtime values for the logger.
static void LOG(QString message, int level=0, QString user="server")
Send a message to the VFS::_messages VFS_stream.
void codeDirectoryUpdated()
Emitted when VFS_creator has had its _plugins updated. This is for VFS_tcp_mount and VFS_tcp_export.
void setAdminEmail(QString emails)
Set the admin email addresses for CRITICAL messages.
static void ERROR(QString message, int level=0, QString user="server")
Send a message to the VFS::_errors VFS_stream.
static void CRITICAL(QString message)
Send a message to the VFS::_critical VFS_stream.
int _logTime
Include log entry time in output, where 0 = none, 1 = locale time, 2 = locale time and date,...
void initialized()
Emitted when the VFS_creator has completed its VFS_creator::build() call.
static QString uptimeString(bool ms=true)
Get the uptime of this VFS instance as a string.
int _monitorTimerID
The timerID for monitoring config file changes.
ColorPrint cp_init
Color settings to print messages when other streams do not exist.
static void WARN(QString message, int level=0, QString user="server")
Send a message to the VFS::_warnings VFS_stream.
VFS(QString configFile, QStringList plugins=QStringList(), bool describe=false, bool printConfig=false)
The VFS constructor will create a VFS based on an incoming config file and list of plugins.
void getLogSettings(int &loglevel, int &logtime)
Get the loglevel and logtime values for the logger.
void monitoredFilesCheck()
Iterate through all monitored files, and check their modification time.
qint64 _start
Set when the VFS instance begins. This is used to track uptime.
static qint64 starttime()
Get the epoch start time of this VFS instance, in milliseconds.
static qint64 uptime()
Get the uptime of this VFS instance, in milliseconds.
virtual QByteArray icon()
Fetch the icon for this node.
ColorPrint cp_error
Color settings for error messages.
static QJsonDocument parameters()
Fetch the parameters assigned to this VFS, as per the config file.
ColorPrint cp_warn
Color settings for warning messages.
VFS_thread * _logger
The VFS_logger instance, which will always be on another thread.
~VFS()
Destroy the VFS node, which will remove references to logging nodes and return output to cp_init colo...
QMutex _printLock
A lock for ensuring that print messags don't get interleaved.
static VFS * _vfs
The global and single instance of VFS, returned by VFS::root()