StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TxEventLogMain.C
1 #include "TxEventLog.h"
2 #include "TxEventLogFactory.h"
3 #include <unistd.h>
4 
5 
6 int main () {
7  TxLogging::TxEventLog* el1 = TxLogging::TxEventLogFactory::create();
8  el1->setBrokerTaskID ("RoopaBrokerTaskID1234");
9  el1->setBrokerJobID (1234);
10  el1->setRequesterName ("Roopa");
11 
12  el1->logEvent ("com.txcorp.ucm.newtask",
13  "brokerID='1', taskName='Roopa's task', taskDescription='Test task from TxEventLogMain', taskSize='1'");
14  el1->logEvent ("com.txcorp.ucm.updatetask",
15  "taskRemainSize='1'");
16 
17  el1->logEvent ("com.txcorp.ucm.addjob",
18  "queue='some queue', queuePosition='2'");
19  el1->logEvent ("com.txcorp.ucm.updatejob",
20  "stateID='4'");
21 
22  el1->setJobSubmitLocation ("some location");
23  el1->setJobSubmitID ("some job id");
24  el1->setJobSubmitState (TxLogging::TxEventLog::STAGEIN);
25 
26  el1->logStart ();
27  sleep (1);
28  el1->logEvent ("test log message");
29  sleep (1);
30  el1->logEvent ("test key", "test value");
31  sleep (1);
32  el1->setJobSubmitLocation ("GRAM");
33  sleep (1);
34  el1->setJobSubmitState (TxLogging::TxEventLog::DONE);
35  sleep (1);
36  el1->setJobSubmitID ("Job ID asdfasdf");
37  el1->logJobAttribute ("queue","Very Long");
38  sleep (1);
39  el1->logEnd ();
40  delete (el1);
41 
42  return 0;
43 }
virtual void setBrokerTaskID(const std::string &brokerTaskID)=0
virtual void logStart(const std::string &key, const std::string &value)=0
virtual void logEnd(const std::string &key, const std::string &value)=0
virtual void setRequesterName(const std::string &requester)=0
virtual void setBrokerJobID(int brokerJobID)=0
virtual void logJobAttribute(const std::string &key, const std::string &value)=0
virtual void logEvent(const std::string &logMsg, Level level=LEVEL_INFO, Stage stage=STATUS, const std::string &msgContext=TxUCMConstants::defaultContext)=0