Compare commits
No commits in common. "2d7e7ba9b7484b5830b4da4718bdc19f916244b2" and "515862acbdae109facc26e6c1296c15fb87b8eb1" have entirely different histories.
2d7e7ba9b7
...
515862acbd
@ -1,18 +1,16 @@
|
|||||||
package fr.pandacube.lib.bungee.util;
|
package fr.pandacube.lib.bungee.util;
|
||||||
|
|
||||||
import com.google.common.io.Files;
|
|
||||||
import fr.pandacube.lib.bungee.PandaLibBungee;
|
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.log.ConciseFormatter;
|
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.concurrent.ThreadFactory;
|
||||||
import java.util.logging.ErrorManager;
|
import java.util.logging.ErrorManager;
|
||||||
import java.util.logging.Filter;
|
import java.util.logging.Filter;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
@ -20,6 +18,11 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.LogRecord;
|
import java.util.logging.LogRecord;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
|
|
||||||
|
import com.google.common.io.Files;
|
||||||
|
import fr.pandacube.lib.bungee.PandaLibBungee;
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.log.ConciseFormatter;
|
||||||
|
|
||||||
public class DailyLogRotateFileHandler extends Handler {
|
public class DailyLogRotateFileHandler extends Handler {
|
||||||
|
|
||||||
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
@ -18,7 +18,7 @@ import static fr.pandacube.lib.chat.ChatStatic.text;
|
|||||||
|
|
||||||
public abstract class BackupCleaner implements UnaryOperator<TreeSet<LocalDateTime>> {
|
public abstract class BackupCleaner implements UnaryOperator<TreeSet<LocalDateTime>> {
|
||||||
|
|
||||||
private static final boolean testOnly = false; // if true, no files are deleted
|
private static final boolean testOnly = true; // if true, no files are deleted
|
||||||
|
|
||||||
public static BackupCleaner KEEPING_N_LAST(int n) {
|
public static BackupCleaner KEEPING_N_LAST(int n) {
|
||||||
return new BackupCleaner() {
|
return new BackupCleaner() {
|
||||||
|
@ -72,7 +72,7 @@ public class RotatedLogsBackupProcess extends BackupProcess {
|
|||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
Log.info("[Backup] Finished for " + ChatColor.GRAY + getDisplayName() + ChatColor.RESET);
|
Log.info("[Backup] Finished for " + ChatColor.GRAY + getDisplayName() + ChatColor.RESET);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
Log.severe("[Backup] Failed for : " + ChatColor.GRAY + getDisplayName() + ChatColor.RESET, e);
|
Log.severe("[Backup] Failed for : " + ChatColor.GRAY + getDisplayName() + ChatColor.RESET, e);
|
||||||
} finally {
|
} finally {
|
||||||
onBackupEnd(success);
|
onBackupEnd(success);
|
||||||
|
Loading…
Reference in New Issue
Block a user