mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Zero MQ implimentation and example (Tutorial3)
git-svn-id: https://subversion.gsi.de/fairroot/fairbase/trunk@20162 0381ead4-6506-0410-b988-94b70fbc4730
This commit is contained in:
45
fairmq/FairMQLogger.h
Normal file
45
fairmq/FairMQLogger.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* FairMQLogger.h
|
||||
*
|
||||
* Created on: Dec 4, 2012
|
||||
* Author: dklein
|
||||
*/
|
||||
|
||||
#ifndef FAIRMQLOGGER_H_
|
||||
#define FAIRMQLOGGER_H_
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
//#ifndef _MAKECINT_
|
||||
#include <sys/time.h>
|
||||
//#endif
|
||||
#include "Rtypes.h"
|
||||
#include "TString.h"
|
||||
|
||||
|
||||
class FairMQLogger
|
||||
{
|
||||
private:
|
||||
static FairMQLogger* instance;
|
||||
TString fBindAddress;
|
||||
public:
|
||||
enum {
|
||||
DEBUG, INFO, ERROR
|
||||
};
|
||||
FairMQLogger();
|
||||
FairMQLogger(TString bindAdress);
|
||||
virtual ~FairMQLogger();
|
||||
void Log(Int_t type, TString logmsg);
|
||||
static FairMQLogger* GetInstance();
|
||||
static FairMQLogger* InitInstance(TString bindAddress);
|
||||
};
|
||||
|
||||
typedef unsigned long long timestamp_t;
|
||||
|
||||
static timestamp_t get_timestamp ()
|
||||
{
|
||||
struct timeval now;
|
||||
gettimeofday (&now, NULL);
|
||||
return now.tv_usec + (timestamp_t)now.tv_sec * 1000000;
|
||||
}
|
||||
|
||||
#endif /* FAIRMQLOGGER_H_ */
|
Reference in New Issue
Block a user