mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
git-svn-id: https://subversion.gsi.de/fairroot/fairbase/trunk@20162 0381ead4-6506-0410-b988-94b70fbc4730
46 lines
859 B
C++
46 lines
859 B
C++
/*
|
|
* 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_ */
|