public static function debug($message, array $content = array(), $module = '') { self::setLogPath(); if ($module != '') { \SeasLog::debug($message, $content, $module); } else { \SeasLog::debug($message, $content); } }
function test_log() { $iCount = 10000; while ($iCount-- > 0) { SeasLog::error(format(array('msg' => "HelloWorld", 'id' => $iCount), "__main__", '123'), array(), 'test1'); } $iCount = 10000; while ($iCount-- > 0) { SeasLog::info(format(array('msg' => "HelloWorld", 'id' => $iCount), "__main__", '123'), array(), 'test2'); } $iCount = 10000; while ($iCount-- > 0) { SeasLog::debug(format(array('msg' => "HelloWorld", 'id' => $iCount), "__main__", '123')); } }
<?php /** * @author ciogao@gmail.com * Date: 15-10-17 下午4:12 */ var_dump(SEASLOG_DETAIL_ORDER_ASC); var_dump(SEASLOG_DETAIL_ORDER_DESC); var_dump(SeasLog::getBasePath()); var_dump(SeasLog::getLastLogger()); SeasLog::debug('debug test'); SeasLog::error('错误{aaa}', array('{aaa}' => 'bbb')); SeasLog::error('错误{aaa}', array('{aaa}' => 'ccc'), 'cc'); SeasLog::log('error', '错误{aaa}', array('{aaa}' => 'ddd')); SeasLog::log('asdf', '错误{aaa}', array()); //Seaslog::debug("test"); var_dump(SeasLog::analyzerCount()); var_dump(Seaslog::analyzerDetail("all", "*", NULL, 1, 10, SEASLOG_DETAIL_ORDER_DESC)); var_dump(SeasLog::analyzerCount(SEASLOG_ALL)); var_dump(Seaslog::analyzerDetail(SEASLOG_ERROR, "*", NULL, 1, 1000, SEASLOG_DETAIL_ORDER_DESC)); var_dump(SeasLog::analyzerCount(SEASLOG_DEBUG)); var_dump(Seaslog::analyzerDetail(SEASLOG_DEBUG));
<?php /** * @author neeke@php.net * Date: 16/5/12 下午4:21 */ $array = ['key' => 'test array']; SeasLog::debug('SeasLog Test: {var}', ['{var}' => $array['key']]);
<?php /** * @author ciogao@gmail.com * Date: 14-1-27 下午4:41 */ SeasLog::getBasePath(); SeasLog::setBasePath('/log/test/base/path'); SeasLog::setLogger('test/logger'); SeasLog::log(SEASLOG_ERROR, 'this is a error test by ::log'); SeasLog::debug('this is a {userName} debug', array('{userName}' => 'neeke')); SeasLog::info('this is a info log'); SeasLog::notice('this is a notice log'); SeasLog::warning('your {website} was down,please {action} it ASAP!', array('{website}' => 'github.com', '{action}' => 'rboot')); SeasLog::error('a error log'); SeasLog::critical('some thing was critical'); SeasLog::alert('yes this is a {messageName}', array('{messageName}' => 'alertMSG')); SeasLog::emergency('Just now, the house next door was completely burnt out! {note}', array('{note}' => 'it`s a joke')); var_dump(SeasLog::analyzerCount()); var_dump(SeasLog::analyzerDetail(SEASLOG_INFO, date('Ymd', time()))); var_dump(SeasLog::analyzerDetail(SEASLOG_DEBUG, date('Ymd', time()), 'neeke', 1, 40)); var_dump(SeasLog::getLastLogger()); $buffer = SeasLog::getBuffer(); var_dump($buffer);