~ubuntu-branches/ubuntu/trusty/log4shib/trusty

« back to all changes in this revision

Viewing changes to include/log4shib/LoggingEvent.hh

  • Committer: Package Import Robot
  • Author(s): Russ Allbery
  • Date: 2012-06-05 21:20:25 UTC
  • Revision ID: package-import@ubuntu.com-20120605212025-uyigtav7dqwvnf41
Tags: upstream-1.0.4
ImportĀ upstreamĀ versionĀ 1.0.4

Show diffs side-by-side

added added

removed removed

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