mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +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];
|
||||
}
|
||||
|
||||
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');
|
||||
fwrite($f, '[' . date(DateTime::RFC1123) . '] ' . $str . PHP_EOL);
|
||||
fclose($f);
|
||||
|
Loading…
x
Reference in New Issue
Block a user