Project

General

Profile

« Previous | Next » 

Revision 0c247ed5

Added by Scott Ullrich over 18 years ago

Add logging helper statements

View differences:

etc/inc/pfsense-utils.inc
583 583
		$weekday = 7;
584 584
	$date	 	= date("d");
585 585
	$defined_days = split(",", $schedule);
586
	log_error("[TDR DEBUG] tdr_day($schedule)");
586 587
	foreach($defined_days as $dd) {
587
		if($date == $dd)
588
		if($date == $dd) {
589
			log_error("[TDR DEBUG] tdr_day($schedule) returning true");
588 590
			return true;
591
		}
589 592
	}
590 593
	return false;
591 594
}
......
597 600
	$starting_time = strtotime($tmp[0]);
598 601
	$ending_time = strtotime($tmp[1]);
599 602
	$now = strtotime("now");
600
	if($debug) 
601
		echo "S: $starting_time E: $ending_time N: $now \n";
602
	if($now >= $starting_time and $now <= $ending_time) 
603
	log_error("[TDR DEBUG] S: $starting_time E: $ending_time N: $now \n");
604
	if($now >= $starting_time and $now <= $ending_time) {
605
		log_error("[TDR DEBUG] tdr_hour() returning true \n");
603 606
		return true;
607
	}
604 608
	return false;
605 609
}
606 610

  
......
614 618
	 */
615 619
	global $debug;
616 620
	$weekday	= date("w");
621
	log_error("[TDR DEBUG] tdr_position($schedule) $weekday");
617 622
	if ($weekday == 0)
618 623
		$weekday = 7;
619 624
	$schedule_days = split(",", $schedule);
620 625
	foreach($schedule_days as $day) {
621
		if($day == $weekday) 
626
		if($day == $weekday) {
627
			log_error("[TDR DEBUG] tdr_position() returning true $day");
622 628
			return true;
629
		}
623 630
	}
624 631
	return false;
625 632
}
......
631 638
	global $debug;
632 639
	$todays_month = date("n");
633 640
	$months = split(",", $schedule);
641
	log_error("[TDR DEBUG] tdr_month($schedule)");
634 642
	foreach($months as $month) {
635
		if($month == $todays_month) 
643
		if($month == $todays_month) {
644
			log_error("[TDR DEBUG] tdr_month($schedule) is returning true $todays_month - $month");
636 645
			return true;
646
		}
637 647
	}
638 648
	return false;
639 649
}

Also available in: Unified diff