debug\ncode optimization
This commit is contained in:
37
constants.php
Normal file
37
constants.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
//Constants
|
||||
define( "EOL", "\n");
|
||||
define("Z2M", "zigbee2mqtt");
|
||||
define("ON", 1);
|
||||
define("OFF", 0);
|
||||
define("AUTO", 0);
|
||||
define("MANUAL", 1);
|
||||
|
||||
// log levels
|
||||
/*define( "DEBUG", 16); // => 16
|
||||
define( "INFO", 1); // => 1
|
||||
define( "NOTICE", 2); // => 2
|
||||
define( "WARNING", 4); // => 4
|
||||
define( "ERROR", 8); // => 8
|
||||
define( "ALERT", 32);
|
||||
|
||||
*/
|
||||
|
||||
$logLevels = array(
|
||||
1 => "INFO",
|
||||
2 => "NOTICE",
|
||||
4 => "WARNING",
|
||||
8 => "ERROR",
|
||||
16 => "DEBUG",
|
||||
32 => "ALERT"
|
||||
);
|
||||
|
||||
foreach ($logLevels as $key => $string)
|
||||
{
|
||||
define($string, $key);
|
||||
}
|
||||
$logLevels[6] = "NOTICE & WARNING";
|
||||
|
||||
define( "ALL", DEBUG | INFO | NOTICE | WARNING | ERROR | ALERT);
|
||||
?>
|
Reference in New Issue
Block a user