replace console with logger

This commit is contained in:
sunxyw
2022-06-08 23:11:17 +08:00
parent 1c40896dc0
commit 4fe74eb5fe
51 changed files with 210 additions and 245 deletions

View File

@@ -7,7 +7,6 @@ namespace ZM\Store;
use Exception;
use Swoole\Table;
use ZM\Annotation\Swoole\OnSave;
use ZM\Console\Console;
use ZM\Event\EventDispatcher;
use ZM\Exception\LightCacheException;
use ZM\Exception\ZMException;
@@ -45,7 +44,7 @@ class LightCache
}
foreach ($r as $k => $v) {
$write = self::set($k, $v);
Console::verbose('Writing LightCache: ' . $k);
logger()->debug('Writing LightCache: ' . $k);
if ($write === false) {
self::$last_error = zm_internal_errcode('E00051') . '可能是由于 Hash 冲突过多导致动态空间无法分配内存';
return false;
@@ -298,7 +297,7 @@ class LightCache
$r = [];
}
foreach ($r as $k => $v) {
Console::verbose('Saving ' . $k);
logger()->debug('Saving ' . $k);
$r[$k] = self::get($k);
}
file_put_contents(self::$config['persistence_path'], json_encode($r, 64 | 128 | 256));
@@ -321,7 +320,7 @@ class LightCache
self::unset($v);
}
Framework::saveFrameworkState($obj);
Console::verbose('Saved.');
logger()->debug('Saved.');
}
private static function checkExpire($key)

View File

@@ -29,7 +29,7 @@ class ZMRedisPool
try {
$r = self::$pool->get()->ping('123');
if (strpos(strtolower($r), '123') !== false) {
Console::debug('成功连接redis连接池');
logger()->debug('成功连接redis连接池');
} else {
var_dump($r);
}