improved mc logs folder cleaning

This commit is contained in:
Steffen Schröder
2014-06-20 16:51:08 +02:00
parent 51e2fde2b0
commit 4a122927dc
2 changed files with 34 additions and 11 deletions

View File

@ -2,6 +2,8 @@
namespace ManiaControl;
use ManiaControl\Files\FileUtil;
/**
* ManiaControl Logger Class
*
@ -16,6 +18,7 @@ class Logger {
*/
public static function setup() {
self::setupErrorLogFileName();
self::cleanLogsFolder();
}
/**
@ -54,6 +57,16 @@ class Logger {
return $logsFolder;
}
/**
* Delete old ManiaControl Log Files
*
* @return bool
*/
private static function cleanLogsFolder() {
$logsFolderPath = self::getLogsFolder();
return FileUtil::cleanDirectory($logsFolderPath);
}
/**
* Log and echo the given Error Message
*