Vidalia 0.3.1
LogEvent.h
Go to the documentation of this file.
1/*
2** This file is part of Vidalia, and is subject to the license terms in the
3** LICENSE file, found in the top level directory of this distribution. If
4** you did not receive the LICENSE file with this file, you may obtain it
5** from the Vidalia source package distributed by the Vidalia Project at
6** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7** including this file, may be copied, modified, propagated, or distributed
8** except according to the terms described in the LICENSE file.
9*/
10
11/*
12** \file LogEvent.h
13** \brief Event dispatched containing a log message from Tor
14*/
15
16#ifndef _LOGEVENT_H
17#define _LOGEVENT_H
18
19#include <QCoreApplication>
20#include <QString>
21#include <QEvent>
22
23
24class LogEvent : public QEvent
25{
26 Q_DECLARE_TR_FUNCTIONS(LogEvent)
27
28public:
29 /** Log message severity levels */
30 enum Severity {
32 Debug = (1u<<4), /**< Debug level log message. */
33 Info = (1u<<3), /**< Info level log message. */
34 Notice = (1u<<2), /**< Notice level log message. */
35 Warn = (1u<<1), /**< Warn level log message. */
36 Error = (1u<<0) /**< Error level log message. */
37 };
38
39 /** Default constructor */
41
42 /** Converts the string description of a severity to its enum value */
43 static Severity toSeverity(QString strSeverity);
44 /** Converts the Severity enum value to a string description */
45 static QString severityToString(Severity severity);
46
47 /** Returns the severity of this log event */
48 Severity severity() const;
49 /** Returns the message for this log event */
50 QString message() const;
51
52private:
54 QString _message;
55};
56
57#endif
58
LogEvent(Severity severity, QString message)
Definition: LogEvent.cpp:21
static QString severityToString(Severity severity)
Definition: LogEvent.cpp:52
static Severity toSeverity(QString strSeverity)
Definition: LogEvent.cpp:30
@ Notice
Definition: LogEvent.h:34
@ Error
Definition: LogEvent.h:36
@ Info
Definition: LogEvent.h:33
@ Debug
Definition: LogEvent.h:32
@ Unknown
Definition: LogEvent.h:31
@ Warn
Definition: LogEvent.h:35
QString _message
Definition: LogEvent.h:54
QString message() const
Definition: LogEvent.cpp:75
Severity _severity
Definition: LogEvent.h:53
Severity severity() const
Definition: LogEvent.cpp:68