Vidalia
0.3.1
src
torcontrol
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
24
class
LogEvent
:
public
QEvent
25
{
26
Q_DECLARE_TR_FUNCTIONS(
LogEvent
)
27
28
public
:
29
/** Log message severity levels */
30
enum
Severity
{
31
Unknown
= 0,
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 */
40
LogEvent
(
Severity
severity
, QString
message
);
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
52
private
:
53
Severity
_severity
;
54
QString
_message
;
55
};
56
57
#endif
58
LogEvent::message
QString message() const
Definition:
LogEvent.cpp:75
LogEvent::severityToString
static QString severityToString(Severity severity)
Definition:
LogEvent.cpp:52
LogEvent::toSeverity
static Severity toSeverity(QString strSeverity)
Definition:
LogEvent.cpp:30
LogEvent::severity
Severity severity() const
Definition:
LogEvent.cpp:68
LogEvent::Notice
@ Notice
Definition:
LogEvent.h:34
LogEvent::Debug
@ Debug
Definition:
LogEvent.h:32
LogEvent::Info
@ Info
Definition:
LogEvent.h:33
LogEvent::Unknown
@ Unknown
Definition:
LogEvent.h:31
LogEvent::LogEvent
LogEvent(Severity severity, QString message)
Definition:
LogEvent.cpp:21
LogEvent::Warn
@ Warn
Definition:
LogEvent.h:35
LogEvent
Definition:
LogEvent.h:24
LogEvent::Severity
Severity
Definition:
LogEvent.h:30
LogEvent::_message
QString _message
Definition:
LogEvent.h:54
LogEvent::Error
@ Error
Definition:
LogEvent.h:36
LogEvent::_severity
Severity _severity
Definition:
LogEvent.h:53
Generated by
1.8.17