Speeding up log processing

This commit is contained in:
dg9vh 2016-09-14 06:46:49 +00:00
parent 5982189c35
commit 4384ff6cdf

View file

@ -1,7 +1,7 @@
<?php
function getMMDVMHostVersion() {
// returns creation-time of MMDVMHost as version-number
// returns creation-time or version of MMDVMHost as version-number
$filename = MMDVMHOSTPATH."/MMDVMHost";
exec($filename." -v 2>&1", $output);
if (!startsWith(substr($output[0],18,8),"20")) {
@ -32,7 +32,7 @@ function getMMDVMConfig() {
}
function getYSFGatewayConfig() {
// loads MMDVM.ini into array for further use
// loads YSFGateway.ini into array for further use
$conf = array();
if ($configs = fopen(YSFGATEWAYINIPATH."/".YSFGATEWAYINIFILENAME, 'r')) {
while ($config = fgets($configs)) {
@ -109,6 +109,7 @@ function showMode($mode, $mmdvmconfigs) {
<?php
}
/*
function getMMDVMLog() {
// Open Logfile and copy loglines into LogLines-Array()
$logLines = array();
@ -122,6 +123,15 @@ function getMMDVMLog() {
}
return $logLines;
}
*/
function getMMDVMLog() {
// Open Logfile and copy loglines into LogLines-Array()
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `grep M: $logPath`);
return $logLines;
}
function getShortMMDVMLog() {
// Open Logfile and copy loglines into LogLines-Array()
@ -131,6 +141,7 @@ function getShortMMDVMLog() {
return $logLines;
}
/*
function getYSFGatewayLog() {
// Open Logfile and copy loglines into LogLines-Array()
$logLines = array();
@ -144,6 +155,15 @@ function getYSFGatewayLog() {
}
return $logLines;
}
*/
function getYSFGatewayLog() {
// Open Logfile and copy loglines into LogLines-Array()
$logPath = YSFGATEWAYLOGPATH."/".YSFGATEWAYLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `grep D: $logPath`);
return $logLines;
}
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901