forked from orocos-toolchain/log4cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoggingEvent.hh
More file actions
81 lines (66 loc) · 2.47 KB
/
LoggingEvent.hh
File metadata and controls
81 lines (66 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* LoggingEvent.hh
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4CPP_LOGGINGEVENT_HH
#define _LOG4CPP_LOGGINGEVENT_HH
#include <log4cpp/Portability.hh>
#include <string>
#include <log4cpp/Priority.hh>
#include <log4cpp/TimeStamp.hh>
/**
* The top level namespace for all 'Log for C++' types and classes.
**/
namespace log4cpp {
/**
* The internal representation of logging events. When a affirmative
* logging decision is made a <code>LoggingEvent</code> instance is
* created. This instance is passed around the different log4cpp
* components.
*
* <p>This class is of concern to those wishing to extend log4cpp.
**/
struct LOG4CPP_EXPORT LoggingEvent {
public:
/**
* Instantiate a LoggingEvent from the supplied parameters.
*
* <p>Except <code>timeStamp</code> all the other fields of
* <code>LoggingEvent</code> are filled when actually needed.
* <p>
* @param category The category of this event.
* @param message The message of this event.
* @param ndc The nested diagnostic context of this event.
* @param priority The priority of this event.
**/
LoggingEvent(const std::string& category, const std::string& message,
const std::string& ndc, Priority::Value priority);
/// create from existing logging event data
LoggingEvent(const std::string& category,
const std::string& message,
const std::string& ndc,
Priority::Value priority,
const std::string& threadName,
TimeStamp& timeStamp);
/** The category name. */
const std::string categoryName;
/** The application supplied message of logging event. */
const std::string message;
/** The nested diagnostic context (NDC) of logging event. */
const std::string ndc;
/** Priority of logging event. */
Priority::Value priority;
/** The name of thread in which this logging event was generated,
e.g. the PID.
*/
const std::string threadName;
/** The number of seconds elapsed since the epoch
(1/1/1970 00:00:00 UTC) until logging event was created. */
TimeStamp timeStamp;
};
}
#endif // _LOG4CPP_LOGGINGEVENT_HH