File: threshold.php

package info (click to toggle)
php-analog 1.0.7-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 424 kB
  • ctags: 232
  • sloc: php: 875; makefile: 12; sh: 5
file content (24 lines) | stat: -rw-r--r-- 477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

require 'Analog.php';

$log = '';

Analog::handler (Analog\Handler\Threshold::init (
	Analog\Handler\Variable::init ($log),
	Analog::ERROR
));

// these will be ignored
Analog::log ('Debugging...', Analog::DEBUG);
Analog::log ('Minor warning...', Analog::WARNING);

echo "Log is still empty:\n" . $log . "\n";

// but these will be logged
Analog::log ('An error...', Analog::ERROR);
Analog::log ('Oh noes!', Analog::URGENT);

echo "Log now has everything:\n" . $log;

?>