This shows you the differences between two versions of the page.
public:paste:logger.php5 [2014-07-10 20:21] – created Johannes Graën | public:paste:logger.php5 [2023-09-15 20:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <file php> | ||
+ | <?php | ||
+ | class Logger | ||
+ | { | ||
+ | private $loglimit = 0; | ||
+ | // some nice colors for 256 color terminals: | ||
+ | private $colors = array(197, | ||
+ | private $counter = 0; | ||
+ | |||
+ | public function __construct($loglimit) | ||
+ | { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | // print colored debug information | ||
+ | public function message($section=' | ||
+ | { | ||
+ | if($loglevel <= $this-> | ||
+ | { | ||
+ | $color = current(array_filter(array($color, | ||
+ | printf(" | ||
+ | ++$this-> | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // highlight a string (by inverting colors) | ||
+ | public function highlight($s) | ||
+ | { | ||
+ | return " | ||
+ | } | ||
+ | |||
+ | // underline a string | ||
+ | public function underline($s) | ||
+ | { | ||
+ | return " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | ?> | ||
+ | </ |