Skip to content
Permalink
Browse files

fix read log speed

  • Loading branch information...
directman66 committed May 5, 2019
1 parent 05aa846 commit 4da675032cbc132dd291baeedf671f38a432ba12
Showing with 18 additions and 3 deletions.
  1. +18 −3 modules/zigbee2mqtt/zigbee2mqtt.class.php
@@ -1308,7 +1308,23 @@ function admin(&$out) {
//$a=file_get_contents ($filename, null,null,1000);
$tmp=file($filename);
//$tmp=file($filename);
//$tmp=file_get_contents ($filename, null,null,1000);
$file = new SplFileObject($filename, 'r');
$file->seek(PHP_INT_MAX);
$last_line = $file->key();
$lines = new LimitIterator($file, $last_line - 500, $last_line);
$tmp=(iterator_to_array($lines));
$newtmp=array_reverse($tmp);
$a="";
foreach ($newtmp as $value)
@@ -1565,7 +1581,7 @@ function admin(&$out) {
$z2m= new zigbee2mqtt();
$z2m->sendcommand("zigbee2mqtt/bridge/config/log_level", "'.$z2m_logmode2.'");
';
SetTimeOut('z2m_set_dubug',$cmd, '60');
SetTimeOut('z2m_set_dubug',$cmd, '1');
@@ -2479,7 +2495,6 @@ function createdb()
// --------------------------------------------------------------------
}

0 comments on commit 4da6750

Please sign in to comment.
You can’t perform that action at this time.