LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
EventLog.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
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 <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
34 #ifndef LSST_CTRL_EVENTS_EVENTLOG_H
35 #define LSST_CTRL_EVENTS_EVENTLOG_H
36 
37 #include <stdlib.h>
38 #include <iostream>
39 
41 #include "lsst/pex/logging/Log.h"
43 #include "lsst/utils/Utils.h"
45 
46 
48 
49 namespace pexLogging = lsst::pex::logging;
50 using namespace std;
51 
52 namespace lsst {
53 namespace ctrl {
54 namespace events {
58 class EventLog : public pexLogging::Log {
59 public:
60  static const std::string LOGGING_TOPIC;
61 
62  EventLog( const std::string runId, int sliceId, const std::string hostId = "", int threshold= pexLogging::Log::INFO);
63  EventLog( const std::string runId, int sliceId, const PropertySet::Ptr& preamble, const std::string hostId = "", int threshold= pexLogging::Log::INFO);
64 
65  virtual ~EventLog();
66 
67  int getEventThreshold() { return _log->getThreshold(); }
68 
69  void setEventThreshold(int thres) {_log->setThreshold(thres); }
70 
71 
72  static void createDefaultLog(const std::string runId, int slideId, const std::string hostId = "", int threshold=Log::INFO);
73  static void createDefaultLog(const std::string runId, int slideId, const PropertySet::Ptr& preamble, const std::string hostId = "", int threshold=Log::INFO);
74 
75 private:
78  void init(const std::string runId, int sliceId, const PropertySet::Ptr& preamble, const std::string hostId, int threshold);
79  void initThres(int threshold);
80 };
81 
82 }
83 }
84 }
85 #endif /* end LSST_CTRL_EVENTS_EVENTLOG_H */
class that send a LogRecord into an event stream
an encapsulation of a logging stream that will filter messages based on their volume (importance) lev...
boost::shared_ptr< PropertySet > Ptr
Definition: PropertySet.h:90
EventFormatter * _formatter
Definition: EventLog.h:77
void setEventThreshold(int thres)
Definition: EventLog.h:69
a place to record messages and descriptions of the state of processing.
Definition: Log.h:154
definition of the DualLog class
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:57
defines the EventFormatter class
static const std::string LOGGING_TOPIC
Definition: EventLog.h:60
static const int INFO
Definition: Log.h:171
Defines the (deprecated) Component class.
pexLogging::LogDestination * _log
Definition: EventLog.h:76
Interface for PropertySet class.
a Log for transmitting log messages as events.
Definition: EventLog.h:58