// Path: src/main/java/de/jeter/chatex/ChatEx.java
// public class ChatEx extends JavaPlugin {
// 
//     private static ChatEx INSTANCE;
//     private UpdateChecker updatechecker = null;
// 
//     @Override
//     public void onEnable() {
//         INSTANCE = this;
// 
//         Config.load();
//         Locales.load();
//         PluginManager.load();
//         ChatLogger.load();
//         RGBColors.load();
// 
//         getServer().getPluginManager().registerEvents(new ChatListener(), this);
//         getServer().getPluginManager().registerEvents(new PlayerListener(), this);
//         getCommand("chatex").setExecutor(new CommandHandler());
// 
//         if (Config.CHECK_UPDATE.getBoolean()) {
//             updatechecker = new UpdateChecker(this, 71041);
//         }
// 
//         ChannelHandler.load();
// 
//         if (Config.B_STATS.getBoolean()) {
//             Metrics metrics = new Metrics(this, 7744);
//             getLogger().info("Thanks for using bstats, it was enabled!");
//         }
// 
//         getLogger().info("is now enabled!");
//     }
// 
//     @Override
//     public void onDisable() {
//         ChatLogger.close();
//         getServer().getScheduler().cancelTasks(this);
//         getLogger().info("is now disabled!");
//     }
// 
//     public static ChatEx getInstance() {
//         return INSTANCE;
//     }
// 
//     public UpdateChecker getUpdateChecker() {
//         return this.updatechecker;
//     }
// }


import de.jeter.chatex.ChatEx;
import org.bukkit.entity.Player;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/*
 * This file is part of ChatEx
 * Copyright (C) 2020 ChatEx Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package de.jeter.chatex.utils;



public class ChatLogger {

    private static BufferedWriter chatWriter = null;
    private static BufferedWriter adWriter = null;

    public static void load() {
        try {
// Path: src/main/java/de/jeter/chatex/ChatEx.java
// public class ChatEx extends JavaPlugin {
// 
//     private static ChatEx INSTANCE;
//     private UpdateChecker updatechecker = null;
// 
//     @Override
//     public void onEnable() {
//         INSTANCE = this;
// 
//         Config.load();
//         Locales.load();
//         PluginManager.load();
//         ChatLogger.load();
//         RGBColors.load();
// 
//         getServer().getPluginManager().registerEvents(new ChatListener(), this);
//         getServer().getPluginManager().registerEvents(new PlayerListener(), this);
//         getCommand("chatex").setExecutor(new CommandHandler());
// 
//         if (Config.CHECK_UPDATE.getBoolean()) {
//             updatechecker = new UpdateChecker(this, 71041);
//         }
// 
//         ChannelHandler.load();
// 
//         if (Config.B_STATS.getBoolean()) {
//             Metrics metrics = new Metrics(this, 7744);
//             getLogger().info("Thanks for using bstats, it was enabled!");
//         }
// 
//         getLogger().info("is now enabled!");
//     }
// 
//     @Override
//     public void onDisable() {
//         ChatLogger.close();
//         getServer().getScheduler().cancelTasks(this);
//         getLogger().info("is now disabled!");
//     }
// 
//     public static ChatEx getInstance() {
//         return INSTANCE;
//     }
// 
//     public UpdateChecker getUpdateChecker() {
//         return this.updatechecker;
//     }
// }


// Path: src/main/java/de/jeter/chatex/utils/ChatLogger.java
import de.jeter.chatex.ChatEx;
import org.bukkit.entity.Player;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/*
 * This file is part of ChatEx
 * Copyright (C) 2020 ChatEx Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package de.jeter.chatex.utils;



public class ChatLogger {

    private static BufferedWriter chatWriter = null;
    private static BufferedWriter adWriter = null;

    public static void load() {
        try {
            File logFolder = new File(ChatEx.getInstance().getDataFolder(), "logs");