static void ArchiveLogs() { try { DebugManager.DebugMessage("** Starting log archive process.", 1); var path = "Logs/OldLogs/" + DateTime.Now.Year + "-" + DateTime.Now.Month; //Make sure folders exist. Directory.CreateDirectory(path); //Move the files. foreach (var file in Directory.GetFiles("Logs", "*.log")) { File.Move(file, path + "/" + Path.GetFileNameWithoutExtension(file) + "-" + TimeManager.GetTimeStamp + Path.GetExtension(file)); } DebugManager.DebugMessage("** Logs has been archived."); } catch (Exception e) { DebugManager.DebugMessage(e.Message); } }
public void OnResourceStart() { DebugManager.DebugMessage("[ChatM] Chat Manager initalized."); NAPI.Server.SetGlobalServerChat(false); }