25 #include "constants.h"
28 #include <ktorrent_export.h>
32 #define LOG_IMPORTANT 0x01
33 #define LOG_NOTICE 0x03
34 #define LOG_DEBUG 0x07
37 #define SYS_GEN 0x0010 // Genereral info messages
38 #define SYS_CON 0x0020 // Connections
39 #define SYS_TRK 0x0040 // Tracker
40 #define SYS_DHT 0x0080 // DHT
41 #define SYS_DIO 0x0100 // Disk IO related stuff, saving and loading of chunks ...
42 #define SYS_UTP 0x0200 // UTP
45 #define SYS_IPF 0x1000 // IPFilter
46 #define SYS_SRC 0x2000 // Search plugin
47 #define SYS_PNP 0x4000 // UPnP plugin
48 #define SYS_INW 0x8000 // InfoWidget
49 #define SYS_SNF 0x10000 // ScanFolder plugin
50 #define SYS_MPL 0x20000 // Media player plugin
51 #define SYS_SCD 0x40000 // Scheduler plugin
52 #define SYS_BTF 0x80000 // BitFinder plugin
53 #define SYS_WEB 0x100000 // WebInterface plugin
54 #define SYS_ZCO 0x200000 // ZeroConf plugin
55 #define SYS_SCR 0x400000 // Scripting plugin
56 #define SYS_SYN 0x800000 // Syndication plugin
61 class LogMonitorInterface;
76 class KTORRENT_EXPORT
Log
118 void setOutputFile(
const QString & file,
bool rotate,
bool handle_qt_messages);
129 return operator << (QString::number(val));
148 Log & operator << (
const char* s);
155 Log & operator << (
const QString & s);
162 Log & operator << (Uint64 v);
169 Log & operator << (Int64 v);
183 Log & operator << (
const QUrl & url);
198 KTORRENT_EXPORT
Log & endl(
Log & lg);
199 KTORRENT_EXPORT
Log & Out(
unsigned int arg = 0x00);
209 KTORRENT_EXPORT
void InitLog(
const QString & file,
bool rotate_logs =
false,
bool handle_qt_messages =
true,
bool to_stdout =
false);
Class which writes messages to a logfile.
KTORRENT_EXPORT friend Log & endl(Log &lg)
void lock()
Lock the mutex of the log, should be called in Out()
void setFilter(unsigned int filter)
void removeMonitor(LogMonitorInterface *m)
void setOutputToConsole(bool on)
void setOutputFile(const QString &file, bool rotate, bool handle_qt_messages)
void logRotateDone()
Called by the auto log rotate job when it has finished.
void addMonitor(LogMonitorInterface *m)
Interface for classes who which to receive which log messages are printed.