Rosetta 3.3
|
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for all your regular io. Channel argument must be related to the location of the source file. For example if you create Tracer object in src/basic/scoring/myfile.cc, then channel must be something like 'src.basic.scoring.myfile'. More...
#include <Tracer.hh>
Classes | |
class | TracerProxy |
Small inner class acting as a proxy to an object that hold it. More... | |
Public Member Functions | |
Tracer (std::string const &channel="", TracerPriority priority=t_info, bool muted_by_default=false) | |
Create Tracer object with given channel and priority. | |
virtual | ~Tracer () |
void | init (Tracer const &tr) |
re-init using data from another tracer object. | |
void | flush_all_channels () |
flush tracer buffer and flush buffers of all sub-channels ie: Fatal, Error, Warning, Info, Debug, Trace | |
bool | visible () const |
Is this tracer currently visible?. | |
bool | visible (int priority) const |
is this tracer visible, if it used the given priority value? | |
int | priority () |
get/set tracer priority level. | |
Tracer & | operator() (int priority) |
void | priority (int priority) |
Static Public Member Functions | |
static void | set_ios_hook (otstreamOP tr, std::string const &monitoring_channels_list) |
set ios hook for all tracer io operation. | |
static void | set_ios_hook (otstreamOP tr, std::string const &monitoring_channels_list, bool raw) |
static TracerOptions & | tracer_options () |
get/set tracer options - global options for Tracer IO. | |
static bool | super_mute () |
global super mute flag that allow to mute all io no matter what. | |
static void | super_mute (bool f) |
Public Attributes | |
TracerProxy | Fatal |
channels with predefined priority levels. | |
TracerProxy | Error |
TracerProxy | Warning |
TracerProxy | Info |
TracerProxy | Debug |
TracerProxy | Trace |
Static Public Attributes | |
static std::string const | AllChannels |
Protected Member Functions | |
virtual void | t_flush (std::string const &) |
overload member function. | |
Friends | |
Tracer & | T (std::string const &, TracerPriority) |
T is special function for assign tracer property on the static object. |
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for all your regular io. Channel argument must be related to the location of the source file. For example if you create Tracer object in src/basic/scoring/myfile.cc, then channel must be something like 'src.basic.scoring.myfile'.
basic::Tracer::Tracer | ( | std::string const & | channel = "" , |
TracerPriority | priority = t_info , |
||
bool | muted_by_default = false |
||
) |
Create Tracer object with given channel and priority.
Constructor of Tracer object. Since most of the Tracer object will be created as static - they Constuctor will be called before Option system is initialized. So we can't really calculate any vizibility or priority here. Such calculation should be done later, whe first IO operation happend.
References priority().
basic::Tracer::~Tracer | ( | ) | [virtual] |
References Debug, Error, Fatal, color_pdb::i, Info, basic::basic_otstream< CharT, Traits >::is_flushed(), Trace, and Warning.
void basic::Tracer::flush_all_channels | ( | ) |
void basic::Tracer::init | ( | Tracer const & | tr | ) |
re-init using data from another tracer object.
References priority().
void basic::Tracer::priority | ( | int | priority | ) |
References basic::TracerOptions::level, and priority().
int basic::Tracer::priority | ( | ) | [inline] |
get/set tracer priority level.
Referenced by operator()(), priority(), and Tracer().
void basic::Tracer::set_ios_hook | ( | otstreamOP | tr, |
std::string const & | monitoring_channels_list, | ||
bool | raw | ||
) | [static] |
Same as above above but gives the option get only the visible and unmuted tracers. It can be useful to get the raw output for applications like the comparing tracers, where the output should not change with command line parameters. It can be useful to get the non-raw output in applications like using the jd2 with MPI, where the output each job should match the output if it was run on a single processor.
References basic::options::OptionKeys::out::file::raw, utility::split(), and tr.
void basic::Tracer::set_ios_hook | ( | otstreamOP | tr, |
std::string const & | monitoring_channels_list | ||
) | [static] |
set ios hook for all tracer io operation.
monitoring_channels_list | is space separated list of channels. |
Set OStringStream object to which all Tracers output listed in the monitoring_channels_list should be copied. Note this copies the output of channels even if they are invisible or muted.
References utility::split(), and tr.
static bool basic::Tracer::super_mute | ( | ) | [inline, static] |
global super mute flag that allow to mute all io no matter what.
static void basic::Tracer::super_mute | ( | bool | f | ) | [inline, static] |
References make_table_of_pilot_apps::f.
void basic::Tracer::t_flush | ( | std::string const & | str | ) | [protected, virtual] |
overload member function.
Inform Tracer that is contents was modified, and IO is in order.
Reimplemented from basic::basic_otstream< CharT, Traits >.
Reimplemented in basic::MemTracer.
References AllChannels, utility::io::oc::cout, and utility::pointer::owning_ptr< T >::get().
Referenced by basic::MemTracer::t_flush().
static TracerOptions& basic::Tracer::tracer_options | ( | ) | [inline, static] |
get/set tracer options - global options for Tracer IO.
is this tracer visible, if it used the given priority value?
References basic::TracerOptions::level.
bool basic::Tracer::visible | ( | ) | const |
Is this tracer currently visible?.
Referenced by main(), and basic::MemTracer::t_flush().
Tracer& T | ( | std::string const & | , |
TracerPriority | |||
) | [friend] |
T is special function for assign tracer property on the static object.
Return reference to static Tracer object (after setting it channel and priority).
std::string const basic::Tracer::AllChannels [static] |
Referenced by t_flush().
Referenced by flush_all_channels(), main(), and ~Tracer().
Referenced by MRMover::apply(), IAMover::apply(), correlation(), flush_all_channels(), main(), read_in_mutations(), statistics(), and ~Tracer().
channels with predefined priority levels.
Referenced by flush_all_channels(), and ~Tracer().
Referenced by flush_all_channels(), and ~Tracer().
Referenced by flush_all_channels(), and ~Tracer().
Referenced by IAMover::assign_IA_mover(), flush_all_channels(), main(), my_main(), basic::options::process(), and ~Tracer().