Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Namespaces | Macros
tracer.h File Reference

Utilities for tracing values in a log file. More...

#include <iostream>
#include <fstream>
#include <string>
#include <memory>
#include <datatools/utils.h>

Go to the source code of this file.

Classes

class  datatools::tracer
 A tracer object stores some arbitrary output in a trace file. More...
 

Namespaces

 datatools
 The Bayeux/datatools library top-level namespace.
 

Macros

#define DT_TRACER_INIT(TracerId, TracerFilename)
 
#define DT_TRACER_TRACE(TracerId, Value)
 
#define DT_TRACER_MESSAGE(TracerId, Message)
 
#define DT_TRACER_RESET(TracerId)
 

Detailed Description

Utilities for tracing values in a log file.

Tracing information from the progress of an application is useful to record the history of some values of interest for example while shooting random numbers and/or associated values.

Macro Definition Documentation

◆ DT_TRACER_INIT

#define DT_TRACER_INIT (   TracerId,
  TracerFilename 
)
Value:
{ \
::datatools::tracer::grab_global_tracer(TracerId,TracerFilename); \
}
static datatools::tracer & grab_global_tracer(int id_, const std::string &filename_="")

◆ DT_TRACER_MESSAGE

#define DT_TRACER_MESSAGE (   TracerId,
  Message 
)
Value:
{ \
if (! t.is_initialized()) t.initialize(TracerId); \
t.out(true) << ' ' << Message << std::endl ; \
}
A tracer object stores some arbitrary output in a trace file.
Definition: tracer.h:40
static datatools::tracer & grab_global_tracer(int id_, const std::string &filename_="")
bool is_initialized() const

◆ DT_TRACER_RESET

#define DT_TRACER_RESET (   TracerId)
Value:
{ \
}
static datatools::tracer & grab_global_tracer(int id_, const std::string &filename_="")

◆ DT_TRACER_TRACE

#define DT_TRACER_TRACE (   TracerId,
  Value 
)
Value:
{ \
if (! t.is_initialized()) t.initialize(TracerId); \
t.trace(Value); \
}
A tracer object stores some arbitrary output in a trace file.
Definition: tracer.h:40
static datatools::tracer & grab_global_tracer(int id_, const std::string &filename_="")
bool is_initialized() const