loglimit = $loglimit; } // print colored debug information public function message($section='_',$loglevel=0,$message,$color=null) { if($loglevel <= $this->loglimit) { $color = current(array_filter(array($color,$this->colors[$loglevel%count($this->colors)]))); printf("\x1b[33m%s%d%'-8d\x1b[0m\t%s\x1b[38;5;%dm%s\x1b[0m\n",$section,$loglevel, ++$this->counter,str_repeat(' ',$loglevel),$color,$message); } } // highlight a string (by inverting colors) public function highlight($s) { return "\x1b[7m".$s."\x1b[27m"; } // underline a string public function underline($s) { return "\x1b[4m".$s."\x1b[24m"; } } ?>