Better debug messages

This commit is contained in:
paul 2006-12-01 16:36:55 +00:00
parent aafdd144d2
commit 2a50ad1cc7
2 changed files with 15 additions and 11 deletions

View File

@ -63,7 +63,7 @@ SchedulerThread :: SchedulerThread(
Ptr<time_duration>::Ref granularity)
throw ()
{
DEBUG_FUNC_INFO
//DEBUG_FUNC_INFO
this->eventContainer = eventContainer;
this->granularity = granularity;
@ -77,7 +77,7 @@ SchedulerThread :: SchedulerThread(
void
SchedulerThread :: getNextEvent(Ptr<ptime>::Ref when) throw ()
{
DEBUG_FUNC_INFO
//DEBUG_FUNC_INFO
nextEvent = eventContainer->getNextEvent(when);
if (nextEvent.get()) {
@ -87,6 +87,9 @@ SchedulerThread :: getNextEvent(Ptr<ptime>::Ref when) throw ()
- *nextEvent->maxTimeToInitialize()));
nextEventEnd.reset(new ptime(*nextEventTime
+ *nextEvent->eventLength()));
debug() << "::getNextEvent() - nextInitTime: " << to_simple_string(*nextInitTime) << endl;
debug() << " - nextEventTime: " << to_simple_string(*nextEventTime) << endl;
debug() << " - nextEventEnd: " << to_simple_string(*nextEventEnd) << endl;
}
}
@ -99,7 +102,7 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
{
if (nextEvent) {
if (imminent(now, nextInitTime)) {
debug() << "event init coming" << endl;
debug() << "::nextStep() - Init [" << *TimeConversion::now() << "]" << endl;
try {
nextEvent->initialize();
} catch (std::exception &e) {
@ -111,10 +114,10 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
<< std::endl;
}
} else if (imminent(now, nextEventTime)) {
debug() << "event start coming" << endl;
Ptr<time_duration>::Ref timeLeft(new time_duration(*nextEventTime
- *now));
TimeConversion::sleep(timeLeft);
debug() << "::nextStep() - Start [" << *TimeConversion::now() << "]" << endl;
nextEvent->start();
currentEvent = nextEvent;
currentEventEnd = nextEventEnd;
@ -123,13 +126,13 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
}
if (currentEvent && imminent(now, currentEventEnd)) {
debug() << "event end coming" << endl;
Ptr<time_duration>::Ref timeLeft(new time_duration(*currentEventEnd
- *now));
TimeConversion::sleep(timeLeft);
currentEvent->stop();
currentEvent->deInitialize();
currentEvent.reset();
debug() << "::nextStep() - End [" << *TimeConversion::now() << "]" << endl;
}
}
@ -140,7 +143,7 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
void
SchedulerThread :: run(void) throw ()
{
DEBUG_FUNC_INFO
//DEBUG_FUNC_INFO
shouldRun = true;
getNextEvent(TimeConversion::now());
@ -168,7 +171,8 @@ SchedulerThread :: run(void) throw ()
void
SchedulerThread :: signal(int signalId) throw ()
{
DEBUG_FUNC_INFO
//DEBUG_FUNC_INFO
debug() << "::signal() - [" << *TimeConversion::now() << "]" << endl;
switch (signalId) {
case UpdateSignal:

View File

@ -95,7 +95,7 @@ PlaylistEvent :: PlaylistEvent(
void
PlaylistEvent :: initialize(void) throw (std::exception)
{
DEBUG_BLOCK
//DEBUG_BLOCK
if (state != created) {
throw std::logic_error("PlaylistEvent in bad state");
@ -124,7 +124,7 @@ PlaylistEvent :: initialize(void) throw (std::exception)
void
PlaylistEvent :: deInitialize(void) throw ()
{
DEBUG_BLOCK
//DEBUG_BLOCK
if (state != stopped) {
// TODO: handle error?
@ -148,7 +148,7 @@ PlaylistEvent :: deInitialize(void) throw ()
void
PlaylistEvent :: start(void) throw ()
{
DEBUG_BLOCK
//DEBUG_BLOCK
if (state != initialized) {
// TODO: handle error?
@ -177,7 +177,7 @@ PlaylistEvent :: start(void) throw ()
void
PlaylistEvent :: stop(void) throw ()
{
DEBUG_BLOCK
//DEBUG_BLOCK
if (state != running) {
// TODO: handle error?