Skip to content

Commit 08e0433

Browse files
committed
Add cycle log function.
1 parent 9172d7e commit 08e0433

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/PHPQueue/Logger.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,14 @@ public static function createLogger($logName=null, $logLevel = Logger::WARNING,
2020

2121
return self::$all_logs[$logName];
2222
}
23+
24+
public static function cycleLog($logName, $logLevel = Logger::WARNING, $logPath=null)
25+
{
26+
if (!empty(self::$all_logs[$logName])) {
27+
unset(self::$all_logs[$logName]);
28+
self::createLogger($logName, $logLevel, $logPath);
29+
}
30+
31+
return self::$all_logs[$logName];
32+
}
2333
}

0 commit comments

Comments
 (0)