mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 17:59:22 +02:00
Add optional $params param into log_append (will log arrays)
This commit is contained in:
parent
9250f20559
commit
ed14f9ada0
@ -879,8 +879,12 @@ function convert_bytes($size)
|
|||||||
return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i];
|
return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i];
|
||||||
}
|
}
|
||||||
|
|
||||||
function log_append($file, $str)
|
function log_append($file, $str, array $params = [])
|
||||||
{
|
{
|
||||||
|
if(count($params) > 0) {
|
||||||
|
$str .= print_r($params, true);
|
||||||
|
}
|
||||||
|
|
||||||
$f = fopen(LOGS . $file, 'ab');
|
$f = fopen(LOGS . $file, 'ab');
|
||||||
fwrite($f, '[' . date(DateTime::RFC1123) . '] ' . $str . PHP_EOL);
|
fwrite($f, '[' . date(DateTime::RFC1123) . '] ' . $str . PHP_EOL);
|
||||||
fclose($f);
|
fclose($f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user