summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class10
1 files changed, 4 insertions, 6 deletions
diff --git a/it.class b/it.class
index 3c9c46c..6840eaa 100644
--- a/it.class
+++ b/it.class
@@ -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);
}