LSSTApplications  11.0-13-gbb96280,12.1.rc1,12.1.rc1+1,12.1.rc1+2,12.1.rc1+5,12.1.rc1+8,12.1.rc1-1-g06d7636+1,12.1.rc1-1-g253890b+5,12.1.rc1-1-g3d31b68+7,12.1.rc1-1-g3db6b75+1,12.1.rc1-1-g5c1385a+3,12.1.rc1-1-g83b2247,12.1.rc1-1-g90cb4cf+6,12.1.rc1-1-g91da24b+3,12.1.rc1-2-g3521f8a,12.1.rc1-2-g39433dd+4,12.1.rc1-2-g486411b+2,12.1.rc1-2-g4c2be76,12.1.rc1-2-gc9c0491,12.1.rc1-2-gda2cd4f+6,12.1.rc1-3-g3391c73+2,12.1.rc1-3-g8c1bd6c+1,12.1.rc1-3-gcf4b6cb+2,12.1.rc1-4-g057223e+1,12.1.rc1-4-g19ed13b+2,12.1.rc1-4-g30492a7
LSSTDataManagementBasePackage
LogEvent.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008-2015 AURA/LSST.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <https://www.lsstcorp.org/LegalNotices/>.
23  */
24 
34 #ifndef LSST_CTRL_EVENTS_LOGEVENT_H
35 #define LSST_CTRL_EVENTS_LOGEVENT_H
36 
37 #include <cms/Connection.h>
38 #include <cms/Session.h>
39 #include <cms/BytesMessage.h>
40 
41 #include <stdlib.h>
42 #include <iostream>
43 
44 #include <log4cxx/spi/loggingevent.h>
45 #include <log4cxx/helpers/pool.h>
46 #include <log4cxx/level.h>
47 
48 #include "lsst/ctrl/events/Event.h"
50 #include "lsst/utils/Utils.h"
52 
54 
55 namespace lsst {
56 namespace ctrl {
57 namespace events {
58 
63 class LogEvent : public StatusEvent
64 {
65 public:
66  static const std::string LEVEL;
67  static const std::string LOGGER;
68 
69 
70  static const std::string MESSAGE;
71  static const std::string TIMESTAMP;
72  static const std::string THREADNAME;
73  static const std::string FILENAME;
74  static const std::string CLASSNAME;
75  static const std::string METHODNAME;
76  static const std::string LINENUMBER;
77  static const std::string LOCATION;
78 
79  static const std::string LOGGING_TOPIC;
80 
81  LogEvent();
82  LogEvent(LocationId const& originatorId, PropertySet const& ps);
83  LogEvent(cms::TextMessage *msg);
84 
85  virtual ~LogEvent();
86 
87  virtual void populateHeader(cms::TextMessage *msg) const;
88 
89  int getLevel();
90 
91  std::string getLoggingTopic();
92  std::string getLogger();
93 
94 private:
95  static const std::string DELIMITER;
96 
97  void _init();
98 
99 };
100 }
101 }
102 }
103 
104 
105 #endif /*end LSST_CTRL_EVENTS_LOGEVENT_H*/
static const std::string LEVEL
Definition: LogEvent.h:66
static const std::string TIMESTAMP
Definition: LogEvent.h:71
static const std::string LOGGING_TOPIC
Definition: LogEvent.h:79
LogEvent()
Creates LogEvent which contains a PropertySet.
Definition: LogEvent.cc:62
Representation of an LSST Event.
Definition: LogEvent.h:63
std::string getLogger()
Retreive the log message.
Definition: LogEvent.cc:119
static const std::string METHODNAME
Definition: LogEvent.h:75
Representation of an LSST Event.
Definition: StatusEvent.h:61
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:59
virtual ~LogEvent()
destructor
Definition: LogEvent.cc:134
static const std::string THREADNAME
Definition: LogEvent.h:72
static const std::string MESSAGE
Definition: LogEvent.h:70
defines the Event class
int getLevel()
retreive the log level
Definition: LogEvent.cc:111
static const std::string CLASSNAME
Definition: LogEvent.h:74
virtual void populateHeader(cms::TextMessage *msg) const
Definition: LogEvent.cc:99
static const std::string LOGGER
Definition: LogEvent.h:67
Class for storing generic metadata.
Definition: PropertySet.h:82
std::string getLoggingTopic()
Retreive the log message.
Definition: LogEvent.cc:127
static const std::string FILENAME
Definition: LogEvent.h:73
Represent process that created an event.
Definition: LocationId.h:52
defines the StatusEvent class
Interface for PropertySet class.
static const std::string LOCATION
Definition: LogEvent.h:77
static const std::string LINENUMBER
Definition: LogEvent.h:76
static const std::string DELIMITER
Definition: LogEvent.h:95