LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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"
49 #include "lsst/utils/Utils.h"
51 
53 
54 using namespace std;
55 
56 namespace lsst {
57 namespace ctrl {
58 namespace events {
59 
64 class LogEvent : public Event
65 {
66 public:
67  static const std::string LEVEL;
68  static const std::string LOGGER;
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(log4cxx::spi::LoggingEventPtr const& event, log4cxx::helpers::Pool& p);
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:67
static const std::string TIMESTAMP
Definition: LogEvent.h:71
def getLevel
Definition: log.py:70
static const std::string LOGGING_TOPIC
Definition: LogEvent.h:79
Representation of an LSST Event.
Definition: LogEvent.h:64
static const std::string METHODNAME
Definition: LogEvent.h:75
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:58
static const std::string THREADNAME
Definition: LogEvent.h:72
static const std::string MESSAGE
Definition: LogEvent.h:70
defines the Event class
static const std::string CLASSNAME
Definition: LogEvent.h:74
Representation of an LSST Event.
Definition: Event.h:62
static const std::string LOGGER
Definition: LogEvent.h:68
static const std::string FILENAME
Definition: LogEvent.h:73
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