diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -70,16 +70,14 @@ static function &cloneobj(&$object) /** * Append all arguments to a logfile (tab separated). Date will be added to filename and line * @param $name Name of logfile. Will be in log/ of service unless it starts with / - * @param $args... Varargs to log, will be tab separated. datetime => ... can be in first arg (dangerous) + * @param $args... Varargs to log, will be tab separated. */ static function log($name /* ... */) { $args = func_get_args(); - $name = array_shift($args); - $timestamp = is_array($args[0]) && ($p = array_shift($args)) && $p['datetime'] ? strtotime($p['datetime']) : time(); - $line = date("Y-m-d H:i:s", $timestamp) . "\t" . implode("\t", $args) . "\n"; + $line = it::date("Y-m-d H:i:s") . "\t" . implode("\t", array_slice($args, 1)) . "\n"; $basefn = substr($name, 0, 1) == "/" ? $name : $GLOBALS['ULTRAHOME'] . "/log/$name"; - $fullfn = $basefn . "-" . date('Ymd', $timestamp); + $fullfn = $basefn . "-" . it::date('Ymd'); if (substr($fullfn, 0, 1) == "/") { @@ -91,7 +89,7 @@ static function log($name /* ... */) @chmod("$fullfn.$tmp", 0664); @rename("$fullfn.$tmp", $fullfn); @unlink($basefn); - if (@readlink($basefn) < basename($fullfn)) + if (@readlink($basefn) < basename($fullfn)) # may be older due to $GLOBALS['debug_time'] @symlink($fullfn, $basefn); } |