105 lines
2.2 KiB
PHP
105 lines
2.2 KiB
PHP
<?php
|
|
namespace Aiko;
|
|
class Debug{
|
|
|
|
private static $firephp = NULL;
|
|
private static $env=NULL;
|
|
public function __construct($env) {
|
|
self::$env=$env;
|
|
if(self::$env==='developer'){
|
|
self::$firephp = \FirePHP::getInstance(true);
|
|
}
|
|
}
|
|
public function info($content,$label='')
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
if($label=='')
|
|
{
|
|
self::$firephp->fb($content,\FirePHP::INFO);
|
|
}else
|
|
{
|
|
self::$firephp->fb($content,$label,\FirePHP::INFO);
|
|
}
|
|
}
|
|
|
|
}
|
|
public function log($content,$label='')
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
if($label=='')
|
|
{
|
|
self::$firephp->fb($content,\FirePHP::LOG);
|
|
}else
|
|
{
|
|
self::$firephp->fb($content,$label,\FirePHP::LOG);
|
|
}
|
|
}
|
|
|
|
}
|
|
public function warning($content,$label='')
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
if($label=='')
|
|
{
|
|
self::$firephp->fb($content,\FirePHP::WARN);
|
|
}else
|
|
{
|
|
self::$firephp->fb($content,$label,\FirePHP::WARN);
|
|
}
|
|
}
|
|
|
|
}
|
|
public function error($content,$label='')
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
if($label=='')
|
|
{
|
|
self::$firephp->fb($content,\FirePHP::ERROR);
|
|
}else
|
|
{
|
|
self::$firephp->fb($content,$label,\FirePHP::ERROR);
|
|
}
|
|
}
|
|
}
|
|
public function trace($label)
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
self::$firephp->fb($label,\FirePHP::TRACE);
|
|
}
|
|
}
|
|
|
|
public function table($content,$label='')
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
if($label=='')
|
|
{
|
|
self::$firephp->fb($content,\FirePHP::TABLE);
|
|
}else
|
|
{
|
|
self::$firephp->fb($content,$label,\FirePHP::TABLE);
|
|
}
|
|
}
|
|
|
|
}
|
|
public function dump($content,$label='')
|
|
{
|
|
if(self::$env==='developer')
|
|
{
|
|
if($label=='')
|
|
{
|
|
self::$firephp->fb($content,\FirePHP::DUMP);
|
|
}else
|
|
{
|
|
self::$firephp->fb($content,$label,\FirePHP::DUMP);
|
|
}
|
|
}
|
|
|
|
}
|
|
private function __clone(){}
|
|
} |