diff options
author | Urban Müller | 2016-01-07 17:56:14 +0100 |
---|---|---|
committer | Urban Müller | 2016-01-07 17:56:14 +0100 |
commit | 7c4ad5b54006acc27b6dc22d3d746d15a2d14520 (patch) | |
tree | 8cdca4409847495e2678f83e689d6e9a9e4b6259 | |
parent | 14675eb397487df6ffa55e399fa585fee7f41da1 (diff) | |
download | itools-7c4ad5b54006acc27b6dc22d3d746d15a2d14520.tar.gz itools-7c4ad5b54006acc27b6dc22d3d746d15a2d14520.tar.bz2 itools-7c4ad5b54006acc27b6dc22d3d746d15a2d14520.zip |
rely on $GLOBALS["debug_time"]
-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); } |