![]() |
Rosetta
2019.12
|
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 'basic.scoring.myfile'. More...
#include <Tracer.hh>
Classes | |
class | TracerProxy |
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. More... | |
Tracer (std::string const &channel, utility::CSI::CSI_Enum const &channel_color, utility::CSI::CSI_Enum const &channel_name_color=utility::CSI::Nothing, TracerPriority priority=t_info, bool muted_by_default=false) | |
Create Tracer object with channel color, channel name color and given channel and priority. More... | |
virtual | ~Tracer () |
Tracer (Tracer const &)=delete | |
Tracer & | operator= (Tracer const &)=delete |
template<typename T > | |
TracerImpl & | operator<< (T const &entry) |
output operator We return a TracerImpl instead of ourself to make subsequent access faster. More... | |
TracerImpl & | operator<< (std::ostream &(*entry)(std::ostream &)) |
operator std::ostream & () | |
Allow Tracer object to be passed to something expecting a std::ostream. More... | |
void | flush () |
void | flush_all_channels () |
flush tracer buffer and flush buffers of all sub-channels ie: Fatal, Error, Warning, Info, Debug, Trace More... | |
bool | visible () |
bool | visible (int priority) |
std::string const & | channel () |
TracerImpl & | operator() (int priority) |
std::streamsize | width () |
std::streamsize | width (std::streamsize wide) |
std::streamsize | precision () |
std::streamsize | precision (std::streamsize prec) |
std::ios_base::fmtflags | flags () |
std::ios_base::fmtflags | flags (std::ios_base::fmtflags fmtfl) |
Static Public Member Functions | |
static void | set_ios_hook (otstreamOP tr, std::string const &monitoring_channels_list, bool raw=true) |
TODO: See if we can kill any usage of this, except for the esoteric. More... | |
static std::string const & | get_all_channels_string () |
static bool | super_mute () |
global super mute flag that allow to mute all io no matter what. More... | |
static void | super_mute (bool f) |
Public Attributes | |
TracerProxy | Fatal |
channels with predefined priority levels. More... | |
TracerProxy | Error |
TracerProxy | Warning |
TracerProxy | Info |
TracerProxy | Debug |
TracerProxy | Trace |
Static Public Attributes | |
static utility::CSI::CSI_Enum | Reset |
static utility::CSI::CSI_Enum | Bold |
static utility::CSI::CSI_Enum | Underline |
static utility::CSI::CSI_Enum | Black |
static utility::CSI::CSI_Enum | Red |
static utility::CSI::CSI_Enum | Green |
static utility::CSI::CSI_Enum | Yellow |
static utility::CSI::CSI_Enum | Blue |
static utility::CSI::CSI_Enum | Magenta |
static utility::CSI::CSI_Enum | Cyan |
static utility::CSI::CSI_Enum | White |
static utility::CSI::CSI_Enum | bgBlack |
static utility::CSI::CSI_Enum | bgRed |
static utility::CSI::CSI_Enum | bgGreen |
static utility::CSI::CSI_Enum | bgYellow |
static utility::CSI::CSI_Enum | bgBlue |
static utility::CSI::CSI_Enum | bgMagenta |
static utility::CSI::CSI_Enum | bgCyan |
static utility::CSI::CSI_Enum | bgWhite |
Protected Member Functions | |
TracerImpl & | tracer_impl () |
The function which handles the construct-on-first use. More... | |
virtual std::unique_ptr < TracerImpl > | create_impl () |
Private Attributes | |
std::string | channel_ |
utility::CSI::CSI_Enum | channel_color_ |
utility::CSI::CSI_Enum | channel_name_color_ |
TracerPriority | priority_ |
bool | muted_by_default_ |
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 'basic.scoring.myfile'.
Intended usage is as a global-scope static object. If you need a heap/stack allocated object, use the TracerImpl class directly.
The funky indirection to TracerImpl here is so that the heavy-weight TracerImpl object is only constructed on first use, and isn't static or thread_local
basic::Tracer::Tracer | ( | std::string const & | channel = "" , |
TracerPriority | priority = t_info , |
||
bool | muted_by_default = false |
||
) |
Create Tracer object with given channel and priority.
basic::Tracer::Tracer | ( | std::string const & | channel, |
utility::CSI::CSI_Enum const & | channel_color, | ||
utility::CSI::CSI_Enum const & | channel_name_color = utility::CSI::Nothing , |
||
TracerPriority | priority = t_info , |
||
bool | muted_by_default = false |
||
) |
Create Tracer object with channel color, channel name color and given channel and priority.
Ex: static basic::Tracer Blue("blue", utility::CSI::Blue);
|
virtualdefault |
Ideally, we'd clean ourselves up from the tracer_impl_map, but that's complicated by it being a) thread-dependent, and b) subject to static initialization order fiasco (static destruction order fiasco) issues. Regardless, the associated TracerImpl will be flushed when the static tracer_impl_map gets destroyed. The one tricky bit is that the TracerImpl for non-static tracers stick around, and may accidentally be re-used if we re-use the same pointer ... so avoid non-static Tracer
objects: use a TracerImpl directly instead.
|
delete |
|
inline |
References basic::TracerImpl::channel(), and tracer_impl().
Referenced by basic::show_time().
|
protectedvirtual |
Reimplemented in basic::MemTracer.
References channel_, channel_color_, channel_name_color_, muted_by_default_, and priority_.
Referenced by tracer_impl().
|
inline |
References tracer_impl().
|
inline |
References tracer_impl().
|
inline |
References tracer_impl().
Referenced by main(), basic::options::process(), and basic::mpi::request_data_from_head_node().
|
inline |
flush tracer buffer and flush buffers of all sub-channels ie: Fatal, Error, Warning, Info, Debug, Trace
References basic::TracerImpl::flush_all_channels(), and tracer_impl().
Referenced by main().
|
inlinestatic |
References basic::TracerImpl::get_all_channels_string().
|
inline |
Allow Tracer object to be passed to something expecting a std::ostream.
References tracer_impl().
|
inline |
References tracer_impl().
|
inline |
output operator We return a TracerImpl instead of ourself to make subsequent access faster.
References basic::TR, and tracer_impl().
|
inline |
References basic::TR, and tracer_impl().
|
inline |
References tracer_impl().
|
inline |
References tracer_impl().
|
inlinestatic |
TODO: See if we can kill any usage of this, except for the esoteric.
References basic::options::OptionKeys::out::file::raw, and basic::TracerImpl::set_ios_hook().
|
inlinestatic |
global super mute flag that allow to mute all io no matter what.
References basic::TracerImpl::super_mute().
|
inlinestatic |
References basic::TracerImpl::super_mute().
|
protected |
The function which handles the construct-on-first use.
References create_impl(), and THREAD_LOCAL.
Referenced by channel(), flags(), flush(), flush_all_channels(), operator std::ostream &(), operator()(), operator<<(), precision(), basic::Tracer::TracerProxy::tracer_proxy_impl(), visible(), and width().
|
inline |
References tracer_impl(), and basic::TracerImpl::visible().
Referenced by main().
References tracer_impl(), and basic::TracerImpl::visible().
|
inline |
References tracer_impl().
|
inline |
References tracer_impl().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
Referenced by create_impl().
|
private |
Referenced by create_impl().
|
private |
Referenced by create_impl().
|
static |
Referenced by build_full_model_test(), and BuildFullModel::fill_and_sample_full_model().
TracerProxy basic::Tracer::Debug |
Referenced by BacksideHbondFinderMover::apply(), build_full_model_test(), calc_scores(), basic::database::schema_generator::Schema::check_table_and_perform_write(), DockFragmentsMover::cluster_frags(), determine_residues_to_rebuild(), drrafter_error_estimation(), basic::database::find_cache_file(), generate_dunbrack_binaries(), basic::mpi::MessageListenerFactory::get_listener(), get_median_structure(), get_simple_RNA_protein_fold_tree(), main(), make_mutations(), mutate_and_score_RNP(), BacksideHbondFinderMover::mutate_residue(), read_in_mutations(), read_pose(), read_structures(), read_thickness(), basic::mpi::request_data_from_head_node(), resample_full_model(), ScoreFragmentSetMover::run(), ConsensusFragmentMover::run(), SolutionRescoreMover::run(), SphereGrinder(), and basic::database::schema_generator::Schema::write().
TracerProxy basic::Tracer::Error |
Referenced by IAMover::apply(), correlation(), get_out_tag(), harvest_motifs(), UBQ_GTPase_disulfide_Mover::init_on_new_input(), UBQ_E2Mover::init_on_new_input(), load_loops_from_file(), main(), basic::datacache::WriteableCacheableDataFactory::new_data_instance(), output_packstat_pdb(), read_in_flexible_regions(), read_in_mutations(), ScoreEachBenchmark::run(), ScoreEachBenchmark::run_long_ranged_two_body_energy(), ScoreEachBenchmark::run_one_body_energy(), ScoreEachBenchmark::run_short_ranged_two_body_energy(), basic::database::safely_prepare_statement(), ScoreEachBenchmark::setUp(), basic::show_time(), statistics(), validate_dunbrack_binaries(), basic::database::schema_generator::Schema::write(), and basic::database::write_schema_to_database().
TracerProxy basic::Tracer::Fatal |
channels with predefined priority levels.
Referenced by DummyMover::apply(), check_option_conflicts(), and basic::options::start_files().
|
static |
Referenced by BuildFullModel::fill_and_sample_full_model().
TracerProxy basic::Tracer::Info |
|
static |
|
private |
Referenced by create_impl().
|
private |
Referenced by create_impl().
|
static |
Referenced by build_full_model_test(), BuildFullModel::fill_and_sample_full_model(), and MC_run().
|
static |
These are just convenience references to the enum entries
Referenced by build_full_model_test(), BuildFullModel::fill_and_sample_full_model(), BuildFullModel::make_built_residues_repulsive(), BuildFullModel::make_built_residues_virtual(), mg_modeler_test(), my_main(), output_seq_with_residue_emphasis(), and swa_rna_sample().
TracerProxy basic::Tracer::Trace |
|
static |
TracerProxy basic::Tracer::Warning |
Referenced by build_full_model_test(), check_number_of_poses(), check_score_function(), filter_combine_long_loop(), basic::database::full_name(), basic::database::get_db_session(), main(), basic::database::parse_database_connection(), basic::database::set_cache_size(), ScoreEachBenchmark::setUp(), and swa_rna_cluster().
|
static |
|
static |