mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Add ability to filter log messages by type.
This commit is contained in:
@@ -12,11 +12,13 @@ namespace Log
|
||||
{
|
||||
enum MsgType
|
||||
{
|
||||
NORMAL,
|
||||
INFO,
|
||||
WARNING,
|
||||
CRITICAL //ERROR is defined by libtorrent and results in compiler error
|
||||
ALL = -1,
|
||||
NORMAL = 0x1,
|
||||
INFO = 0x2,
|
||||
WARNING = 0x4,
|
||||
CRITICAL = 0x8 //ERROR is defined by libtorrent and results in compiler error
|
||||
};
|
||||
Q_DECLARE_FLAGS(MsgTypes, MsgType)
|
||||
|
||||
struct Msg
|
||||
{
|
||||
@@ -36,6 +38,8 @@ namespace Log
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Log::MsgTypes)
|
||||
|
||||
class Logger : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -871,6 +871,18 @@ void Preferences::setExecutionLogEnabled(bool b)
|
||||
setValue("Preferences/ExecutionLog/enabled", b);
|
||||
}
|
||||
|
||||
int Preferences::executionLogMessageTypes() const
|
||||
{
|
||||
// as default value we need all the bits set
|
||||
// -1 is considered the portable way to achieve that
|
||||
return value("MainWindow/ExecutionLog/Types", -1).toInt();
|
||||
}
|
||||
|
||||
void Preferences::setExecutionLogMessageTypes(const int &value)
|
||||
{
|
||||
setValue("MainWindow/ExecutionLog/Types", value);
|
||||
}
|
||||
|
||||
// Queueing system
|
||||
bool Preferences::isQueueingSystemEnabled() const
|
||||
{
|
||||
|
||||
@@ -276,6 +276,8 @@ public:
|
||||
// Execution Log
|
||||
bool isExecutionLogEnabled() const;
|
||||
void setExecutionLogEnabled(bool b);
|
||||
int executionLogMessageTypes() const;
|
||||
void setExecutionLogMessageTypes(const int &value);
|
||||
|
||||
// Queueing system
|
||||
bool isQueueingSystemEnabled() const;
|
||||
|
||||
Reference in New Issue
Block a user