void TimerManager::DumpTimerList(int flag, const char* indent) { Timer *timer_ptr; const char *ptmp; // we want to allow flag to be "D_FULLDEBUG | D_DAEMONCORE", // and only have output if _both_ are specified by the user // in the condor_config. this is a little different than // what dprintf does by itself ( which is just // flag & DebugFlags > 0 ), so our own check here: if ( ! IsDebugCatAndVerbosity(flag) ) return; if ( indent == NULL) indent = DEFAULT_INDENT; dprintf(flag, "\n"); dprintf(flag, "%sTimers\n", indent); dprintf(flag, "%s~~~~~~\n", indent); for(timer_ptr = timer_list; timer_ptr != NULL; timer_ptr = timer_ptr->next) { if ( timer_ptr->event_descrip ) ptmp = timer_ptr->event_descrip; else ptmp = "NULL"; std::string slice_desc; if( !timer_ptr->timeslice ) { formatstr(slice_desc, "period = %d, ", timer_ptr->period); } else { formatstr_cat(slice_desc, "timeslice = %.3g, ", timer_ptr->timeslice->getTimeslice()); if( !IS_ZERO(timer_ptr->timeslice->getDefaultInterval()) ) { formatstr_cat(slice_desc, "period = %.1f, ", timer_ptr->timeslice->getDefaultInterval()); } if( !IS_ZERO(timer_ptr->timeslice->getInitialInterval()) ) { formatstr_cat(slice_desc, "initial period = %.1f, ", timer_ptr->timeslice->getInitialInterval()); } if( !IS_ZERO(timer_ptr->timeslice->getMinInterval()) ) { formatstr_cat(slice_desc, "min period = %.1f, ", timer_ptr->timeslice->getMinInterval()); } if( !IS_ZERO(timer_ptr->timeslice->getMaxInterval()) ) { formatstr_cat(slice_desc, "max period = %.1f, ", timer_ptr->timeslice->getMaxInterval()); } } dprintf(flag, "%sid = %d, when = %ld, %shandler_descrip=<%s>\n", indent, timer_ptr->id, (long)timer_ptr->when, slice_desc.c_str(),ptmp); } dprintf(flag, "\n"); }
// dprint() method void UserLogHeader::dprint( int level, MyString &buf ) const { if ( ! IsDebugCatAndVerbosity(level) ) { return; } sprint_cat( buf ); ::dprintf( level, "%s\n", buf.Value() ); }
// dprint() method void UserLogHeader::dprint( int level, const char *label ) const { if ( ! IsDebugCatAndVerbosity(level) ) { return; } if ( NULL == label ) { label = ""; } MyString buf; buf.formatstr( "%s header:", label ); this->dprint( level, buf ); }
void dumpClassad( const char* header, ClassAd* ad, int debug_flag ) { if( ! header ) { dprintf( D_ALWAYS, "ERROR: called dumpClassad() w/ NULL header\n" ); return; } if( ! ad ) { dprintf( D_ALWAYS, "ERROR: called dumpClassad(\"%s\") w/ NULL ad\n", header ); return; } if( IsDebugCatAndVerbosity(debug_flag) ) { dprintf( debug_flag, "*** ClassAd Dump: %s ***\n", header ); ad->dPrint( debug_flag ); dprintf( debug_flag, "--- End of ClassAd ---\n" ); } }